From 83d2a442e197ca981fe09951ca4c8029a3af28eb Mon Sep 17 00:00:00 2001 From: Lucian Petrut Date: Mon, 21 Nov 2022 15:18:09 +0200 Subject: [PATCH] libcephfs: replace errno.h errors with CEPHFS_E* libcephfs and the associated tests were still using errno.h values in a few places, which we're now going to replace with portable CEPHFS_E* values. Signed-off-by: Lucian Petrut --- src/libcephfs.cc | 2 +- src/test/libcephfs/test.cc | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/libcephfs.cc b/src/libcephfs.cc index 0e006a18fbe..99da0c5c5c8 100644 --- a/src/libcephfs.cc +++ b/src/libcephfs.cc @@ -663,7 +663,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 = CEPHFS_ENOTCONN; return nullptr; } return cmount->get_client()->readdir(reinterpret_cast(dirp)); diff --git a/src/test/libcephfs/test.cc b/src/test/libcephfs/test.cc index c119107b309..3fb301ea72f 100644 --- a/src/test/libcephfs/test.cc +++ b/src/test/libcephfs/test.cc @@ -268,7 +268,7 @@ TEST(LibCephFS, OpenLayout) { ASSERT_LT(0, ceph_get_file_pool_name(cmount, fd, poolname, sizeof(poolname))); ASSERT_LT(0, ceph_get_file_pool_name(cmount, fd, poolname, 0)); - /* on already-written file (ENOTEMPTY) */ + /* on already-written file (CEPHFS_ENOTEMPTY) */ ceph_write(cmount, fd, "hello world", 11, 0); ceph_close(cmount, fd); @@ -1358,7 +1358,7 @@ TEST(LibCephFS, UseUnmounted) { EXPECT_EQ(-CEPHFS_ENOTCONN, ceph_closedir(cmount, dirp)); ceph_readdir(cmount, dirp); - EXPECT_EQ(ENOTCONN, errno); + EXPECT_EQ(CEPHFS_ENOTCONN, errno); struct dirent rdent; EXPECT_EQ(-CEPHFS_ENOTCONN, ceph_readdir_r(cmount, dirp, &rdent)); -- 2.39.5