summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDanny Al-Gaaf <danny.al-gaaf@bisect.de>2013-05-10 13:55:43 +0200
committerDanny Al-Gaaf <danny.al-gaaf@bisect.de>2013-05-11 00:02:55 +0200
commit5babc816e052fe78a6be0fc129b7bff11673514f (patch)
tree42ace80ca2aa51d79a3e212306940042bde4072e /src
parent4908079c20a3adedf32e728f603494a1e536c710 (diff)
downloadceph-5babc816e052fe78a6be0fc129b7bff11673514f.tar.gz
rbd.cc: fix error handling
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>
Diffstat (limited to 'src')
-rw-r--r--src/rbd.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/rbd.cc b/src/rbd.cc
index 79860c2d772..3e586bd4dcb 100644
--- a/src/rbd.cc
+++ b/src/rbd.cc
@@ -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;
}