]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
BlueStore: negative return code if we unable to open path
authorxie xingguo <xie.xingguo@zte.com.cn>
Mon, 18 Jan 2016 07:14:23 +0000 (15:14 +0800)
committerxie xingguo <xie.xingguo@zte.com.cn>
Mon, 18 Jan 2016 07:14:23 +0000 (15:14 +0800)
Because the caller is unable to catch a positive error code.

Fixes: #14393
Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
src/os/bluestore/BlueStore.cc

index b65deaae89916c82547c989f735d8b8218400656..8ed73cc98bed2dde1ae948ec555fc1e134b69287 100644 (file)
@@ -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;