]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
src/rbd.cc: silence CID COPY_PASTE_ERROR warning
authorDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Fri, 17 May 2013 12:15:23 +0000 (14:15 +0200)
committerDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Wed, 22 May 2013 13:45:18 +0000 (15:45 +0200)
CID 1021212 (#1 of 1): Copy-paste error (COPY_PASTE_ERROR)
  copy_paste_error: "r" in "r = -*__errno_location()" looks like
  a copy-paste error. Should it say "fd" instead?

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

index 17ccd061dc1cdd27f2e0aff32c73a6ce5008abd7..c9b2f0a272ca31e27b76a0fb8f902ef075f5476e 100644 (file)
@@ -1296,16 +1296,13 @@ static int do_import(librbd::RBD &rbd, librados::IoCtx& io_ctx,
     fd = 0;
     size = 1ULL << *order;
   } else {
-    fd = open(path, O_RDONLY);
-
-    if (fd < 0) {
+    if ((fd = open(path, O_RDONLY)) < 0) {
       r = -errno;
       cerr << "rbd: error opening " << path << std::endl;
       goto done2;
     }
 
-    r = fstat(fd, &stat_buf);
-    if (r < 0) {
+    if ((fstat(fd, &stat_buf)) < 0) {
       r = -errno;
       cerr << "rbd: stat error " << path << std::endl;
       goto done;