]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
os/newstore: fix swarning 5748/head
authorSage Weil <sage@redhat.com>
Tue, 1 Sep 2015 17:59:40 +0000 (13:59 -0400)
committerSage Weil <sage@redhat.com>
Tue, 1 Sep 2015 17:59:40 +0000 (13:59 -0400)
os/newstore/NewStore.cc: In member function 'int NewStore::_zero(NewStore::TransContext*, NewStore::CollectionRef&, const ghobject_t&, uint64_t, size_t)':
os/newstore/NewStore.cc:3693:32: warning: ignoring return value of 'int ftruncate(int, __off64_t)', declared with attribute warn_unused_result [-Wunused-result]
       ::ftruncate(fd, f.length);
                                ^

Signed-off-by: Sage Weil <sage@redhat.com>
src/os/newstore/NewStore.cc

index 58d3aff9d85c2bd6aee51c1b8ad3c92fed127869..953dcd22d58643d3737b263c09ca495b5f4ad818 100644 (file)
@@ -3690,7 +3690,8 @@ int NewStore::_zero(TransContext *txc,
        goto out;
       }
       f.length = (offset + length) - f.offset;
-      ::ftruncate(fd, f.length);
+      r = ::ftruncate(fd, f.length);
+      assert(r == 0);   // this shouldn't fail
       dout(20) << __func__ << " tail " << f.fid << " truncating up to "
               << f.length << dendl;
       o->onode.size = offset + length;