Skip to content

Instantly share code, notes, and snippets.

@saghul
Created February 26, 2014 22:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save saghul/9240298 to your computer and use it in GitHub Desktop.
Save saghul/9240298 to your computer and use it in GitHub Desktop.
diff --git a/src/unix/fs.c b/src/unix/fs.c
index ce8798c..b06f992 100644
--- a/src/unix/fs.c
+++ b/src/unix/fs.c
@@ -598,7 +598,7 @@ static ssize_t uv__fs_write(uv_fs_t* req) {
# endif
written = 0;
index = 0;
- r = 1;
+ r = 0;
do {
if (req->bufs[index].len > 0) {
r = pwrite(req->file,
@@ -609,7 +609,7 @@ static ssize_t uv__fs_write(uv_fs_t* req) {
written += r;
}
index++;
- } while (index < req->nbufs && r > 0);
+ } while (index < req->nbufs && r >= 0);
if (written > 0)
r = written;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment