Created
February 26, 2014 22:41
-
-
Save saghul/9240298 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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