[PATCH] splice-bench: error checking
authorJens Axboe <axboe@suse.de>
Thu, 27 Apr 2006 11:19:56 +0000 (13:19 +0200)
committerJens Axboe <axboe@suse.de>
Thu, 27 Apr 2006 11:19:56 +0000 (13:19 +0200)
splice-bench.c

index 65dcd4c2f2a46f852116cd4bfa845e4492ba01ae..5419eca33099ff9826f5e68b65fff352d5af1f5e 100644 (file)
@@ -372,12 +372,23 @@ int client_splice(int out_fd, int file_fd, int offset)
 
 int do_client(int out_fd, int file_fd, int offset)
 {
-       if (run_splice)
-               client_splice(out_fd, file_fd, offset);
-       if (run_mmap)
-               client_mmap(out_fd, file_fd, offset);
-       if (run_rw)
-               client_rw(out_fd, file_fd, offset);
+       int ret;
+
+       if (run_splice) {
+               ret = client_splice(out_fd, file_fd, offset);
+               if (ret)
+                       return ret;
+       }
+       if (run_mmap) {
+               ret = client_mmap(out_fd, file_fd, offset);
+               if (ret)
+                       return ret;
+       }
+       if (run_rw) {
+               ret = client_rw(out_fd, file_fd, offset);
+               if (ret)
+                       return ret;
+       }
        return 0;
 }