From 5377d8727172a1ac8a069c24f88b78601400427b Mon Sep 17 00:00:00 2001 From: xie xingguo Date: Sat, 18 Jun 2016 14:03:48 +0800 Subject: [PATCH] libcephfs: fix incorrectly set errno POSIX asks for positive errno, so a negative errno won't be portable and can get weird respondings. Signed-off-by: xie xingguo --- src/libcephfs.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libcephfs.cc b/src/libcephfs.cc index 4c56ee04cc3bd..d046334841189 100644 --- a/src/libcephfs.cc +++ b/src/libcephfs.cc @@ -481,7 +481,7 @@ extern "C" struct dirent * ceph_readdir(struct ceph_mount_info *cmount, struct c { if (!cmount->is_mounted()) { /* Client::readdir also sets errno to signal errors. */ - errno = -ENOTCONN; + errno = ENOTCONN; return NULL; } return cmount->get_client()->readdir(reinterpret_cast(dirp)); -- 2.39.5