From 501e825416e5f83cd046947b49ec8345c377f601 Mon Sep 17 00:00:00 2001 From: songbaisen Date: Thu, 26 May 2016 15:56:26 +0800 Subject: [PATCH] cephfs: should give a value before use cpp_strerror Signed-off-by:song baisen --- src/cephfs.cc | 1 + 1 file changed, 1 insertion(+) 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; } -- 2.47.3