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

index 73bb30d852e9a2343dab0dd2dae8bc0a30cd6e08..a0db0453471f1c69b903f05048435661a8c4259e 100644 (file)
@@ -23,6 +23,8 @@
 #include <unistd.h>
 
 // ceph
+#include "common/errno.h"
+#include "common/safe_io.h"
 #include "include/types.h"
 #include "Client.h"
 #include "config.h"
@@ -434,8 +436,13 @@ static void do_init(void *foo, fuse_conn_info *bar)
 {
   if (fd_on_success) {
     //cout << "fuse init signaling on fd " << fd_on_success << std::endl;
-    int r = 0;
-    ::write(fd_on_success, &r, sizeof(r));
+    uint32_t r = 0;
+    int err = safe_write(fd_on_success, &r, sizeof(r));
+    if (err) {
+      derr << "fuse_ll: do_init: safe_write failed with error "
+          << cpp_strerror(err) << dendl;
+      ceph_abort();
+    }
     //cout << "fuse init done signaling on fd " << fd_on_success << std::endl;
 
     // close stdout, etc.