Whamcloud - gitweb
b=22168 write_disjoint: retry if write receives EINTR.
authorEric Mei <eric.mei@oracle.com>
Wed, 6 Oct 2010 15:16:23 +0000 (09:16 -0600)
committerAndrew Perepechko <andrew.perepechko@oracle.com>
Wed, 6 Oct 2010 15:19:56 +0000 (19:19 +0400)
o=robert.read
r=eric.mei

lustre/tests/mpi/write_disjoint.c

index 9982bcc..f5b3454 100644 (file)
@@ -161,10 +161,11 @@ int main (int argc, char *argv[]) {
                 do {
                         ret = write(fd, chunk_buf[rank] + done,
                                     CHUNK_SIZE(n) - done);
-                        if (ret < 0)
+                        if (ret < 0 && errno != EINTR)
                                 rprintf(rank, n, "write() returned %s\n",
                                         strerror(errno));
-                        done += ret;
+                        if (ret > 0)
+                                done += ret;
                 } while (done != CHUNK_SIZE(n));
 
                 MPI_Barrier(MPI_COMM_WORLD);