From: songbaisen Date: Thu, 26 May 2016 07:56:26 +0000 (+0800) Subject: cephfs: should give a value before use cpp_strerror X-Git-Tag: v11.0.0~419^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F9338%2Fhead;p=ceph.git cephfs: should give a value before use cpp_strerror Signed-off-by:song baisen --- diff --git a/src/cephfs.cc b/src/cephfs.cc index fe2d6c6abde..a4d2ddf98e2 100644 --- a/src/cephfs.cc +++ b/src/cephfs.cc @@ -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; }