]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
os/FileStore.cc: use safe_write
authorColin Patrick McCabe <cmccabe@alumni.cmu.edu>
Thu, 10 Feb 2011 14:43:35 +0000 (06:43 -0800)
committerColin Patrick McCabe <cmccabe@alumni.cmu.edu>
Thu, 10 Feb 2011 14:47:55 +0000 (06:47 -0800)
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
src/os/FileStore.cc

index ceae3a7fa894c6f48e735d547584660036139007..4e49ba2e78461892bf0de177766d1156f9a28a72 100644 (file)
@@ -690,9 +690,8 @@ int FileStore::mkfs()
   // fsid
   srand(time(0) + getpid());
   fsid = rand();
-  if (TEMP_FAILURE_RETRY(::write(fsid_fd, &fsid, sizeof(fsid)))
-       != sizeof(fsid)) {
-    ret = errno;
+  ret = safe_write(fsid_fd, &fsid, sizeof(fsid));
+  if (ret) {
     derr << "FileStore::mkfs: failed to write fsid: "
         << cpp_strerror(ret) << dendl;
     goto close_fsid_fd;
@@ -2337,7 +2336,7 @@ int FileStore::_do_clone_range(int from, int to, uint64_t off, uint64_t len)
     }
     int op = 0;
     while (op < r) {
-      int r2 = ::write(to, buf+op, r-op);
+      int r2 = safe_write(to, buf+op, r-op);
       dout(25) << " write to " << to << "~" << (r-op) << " got " << r2 << dendl;      
       if (r2 < 0) {
        r = r2;