]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
cephfs: should give a value before use cpp_strerror 9338/head
authorsongbaisen <song.baisen@zte.com.cn>
Thu, 26 May 2016 07:56:26 +0000 (15:56 +0800)
committersongbaisen <song.baisen@zte.com.cn>
Thu, 26 May 2016 07:58:19 +0000 (15:58 +0800)
Signed-off-by:song baisen <song.baisen@zte.com.cn>

src/cephfs.cc

index fe2d6c6abde56f6ecfb5b7d9815d85a87e242f58..a4d2ddf98e2c466dda365790c9c88afac0c92e6a 100644 (file)
@@ -194,6 +194,7 @@ int init_options(int argc, char **argv, int *fd, char **path, int *cmd,
 
   *fd = open(argv[1], O_RDONLY);
   if (*fd < 0) {
+    *fd = -errno;
     cerr << "error opening path: " << cpp_strerror(*fd) << endl;
     return 1;
   }