git » libjio » commit d2d9ad3

spwrite(): Retry when nothing was written

author Alberto Bertogli
2009-07-15 18:40:35 UTC
committer Alberto Bertogli
2009-07-15 18:40:35 UTC
parent 647481368258add0cbff042f661384c1597f07fb

spwrite(): Retry when nothing was written

Signed-off-by: Alberto Bertogli <albertito@blitiri.com.ar>

libjio/common.c +1 -3

diff --git a/libjio/common.c b/libjio/common.c
index b8a7be5..c85278f 100644
--- a/libjio/common.c
+++ b/libjio/common.c
@@ -87,10 +87,8 @@ ssize_t spwrite(int fd, const void *buf, size_t count, off_t offset)
 		rv = pwrite(fd, (char *) buf + c, count - c, offset + c);
 
 		if (rv == count)
-			/* we're done */
 			return count;
-		else if (rv <= 0)
-			/* error/nothing was written */
+		else if (rv < 0)
 			return rv;
 
 		/* incomplete write, keep on writing */