From: xie xingguo Date: Mon, 18 Jan 2016 07:14:23 +0000 (+0800) Subject: BlueStore: negative return code if we unable to open path X-Git-Tag: v10.0.4~195^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=5ff452bbf5be851bddb544c4ee0908323c30c5c3;p=ceph.git BlueStore: negative return code if we unable to open path Because the caller is unable to catch a positive error code. Fixes: #14393 Signed-off-by: xie xingguo --- diff --git a/src/os/bluestore/BlueStore.cc b/src/os/bluestore/BlueStore.cc index b65deaae8991..8ed73cc98bed 100644 --- a/src/os/bluestore/BlueStore.cc +++ b/src/os/bluestore/BlueStore.cc @@ -859,7 +859,7 @@ int BlueStore::_write_bdev_label(string path, bluestore_bdev_label_t label) int fd = ::open(path.c_str(), O_WRONLY); if (fd < 0) { - fd = errno; + fd = -errno; derr << __func__ << " failed to open " << path << ": " << cpp_strerror(fd) << dendl; return fd;