]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
libcephfs: replace errno.h errors with CEPHFS_E*
authorLucian Petrut <lpetrut@cloudbasesolutions.com>
Mon, 21 Nov 2022 13:18:09 +0000 (15:18 +0200)
committerLucian Petrut <lpetrut@cloudbasesolutions.com>
Mon, 21 Nov 2022 13:23:29 +0000 (15:23 +0200)
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 <lpetrut@cloudbasesolutions.com>
src/libcephfs.cc
src/test/libcephfs/test.cc

index 0e006a18fbebb0d8e3e41c41da0963ee26965ba8..99da0c5c5c8da5c9dc57c613c991c5049e8b15de 100644 (file)
@@ -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<dir_result_t*>(dirp));
index c119107b30977bb3b1d95b8daec254fcaa4cd892..3fb301ea72fae4efd408540f4ec4a24c5675efba 100644 (file)
@@ -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));