]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rbd.cc: fix error handling
authorDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Fri, 10 May 2013 11:55:43 +0000 (13:55 +0200)
committerDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Fri, 10 May 2013 22:02:55 +0000 (00:02 +0200)
Fix undead code. Get error code from write_fd() before check
the result against < 0.

CID 1019550 Logically dead code (CWE-561)

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
src/rbd.cc

index 79860c2d772e2d0e89fcd00f8a927f76be02b567..3e586bd4dcbab0eb12b9251fc640821cde5c777f 100644 (file)
@@ -1141,7 +1141,7 @@ static int do_export_diff(librbd::Image& image, const char *fromsnapname,
     __u8 tag = 'e';
     bufferlist bl;
     ::encode(tag, bl);
-    bl.write_fd(fd);
+    r = bl.write_fd(fd);
     if (r < 0)
       return r;
   }