]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
test_disk_bw.cc: use safe_write
authorColin Patrick McCabe <cmccabe@alumni.cmu.edu>
Thu, 10 Feb 2011 13:49:10 +0000 (05:49 -0800)
committerColin Patrick McCabe <cmccabe@alumni.cmu.edu>
Thu, 10 Feb 2011 13:49:10 +0000 (05:49 -0800)
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
src/test/old/test_disk_bw.cc

index fc36da74fadb25714956de8491cd9058a0223ae9..69985dfe37ba8f60e27e3b56804744f374666450 100644 (file)
@@ -11,6 +11,7 @@
 #include <sys/uio.h>
 
 #include "common/Clock.h"
+#include "common/safe_io.h"
 
 #include <iostream>
 using namespace std;
@@ -40,7 +41,9 @@ int main(int argc, char **argv)
  
   utime_t start = g_clock.now();
   while (loop++ < count) {
-    ret = ::write(fd, buf, bsize);
+    ret = safe_write(fd, buf, bsize);
+    if (ret)
+      ceph_abort();
     //if ((loop % 100) == 0) 
     //fprintf(stderr, ".");
   }