]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
include: move ALLPERMS definition to compat.h 50988/head
authorLucian Petrut <lpetrut@cloudbasesolutions.com>
Thu, 30 Mar 2023 12:14:10 +0000 (12:14 +0000)
committerXiubo Li <xiubli@redhat.com>
Tue, 11 Apr 2023 02:49:25 +0000 (10:49 +0800)
The Windows CI job started to fail as some libcephfs tests that use
ALLPERMS have been moved [1] to a separate file which doesn't have
the ALLPERMS definition.

  /ceph/src/test/libcephfs/suidsgid.cc:240:36: error: ‘ALLPERMS’ was
  not declared in this scope
  240 |   ASSERT_EQ(stx.stx_mode & (mode_t)ALLPERMS, before_mode);

We'll move this definition to compat.h so that we won't have to
redefine it in each file that uses it.

Note that we're moving the Windows "fs_compat.h" include up,
ensuring that the constants used by ALLPERMS are defined.

[1] https://github.com/ceph/ceph/commit/254eeb2730881ee48b4743e1422749d5b643f52a

Signed-off-by: Lucian Petrut <lpetrut@cloudbasesolutions.com>
(cherry picked from commit a2966c08171e006acfd9c32b00a1294f428c7e62)
Conflicts:
 - src/test/libcephfs/test.cc: with 'using namespace std'.

src/include/compat.h
src/test/libcephfs/test.cc
src/test/libcephfs/vxattr.cc

index 7537412956673f9be5729da9e2540dbaab43a415..1fc18a23b62fd6cef694531ba5ea596c42121f7c 100644 (file)
 #endif
 
 #include <sys/stat.h>
+
+#ifdef _WIN32
+#include "include/win32/fs_compat.h"
+#endif
+
 #ifndef ACCESSPERMS
 #define ACCESSPERMS (S_IRWXU|S_IRWXG|S_IRWXO)
 #endif
 
+#ifndef ALLPERMS
+#define ALLPERMS (S_ISUID|S_ISGID|S_ISVTX|S_IRWXU|S_IRWXG|S_IRWXO)
+#endif
+
 #if defined(__FreeBSD__)
 
 // FreeBSD supports Linux procfs with its compatibility module
@@ -223,7 +232,6 @@ int ceph_memzero_s(void *dest, size_t destsz, size_t count);
 #include <time.h>
 
 #include "include/win32/win32_errno.h"
-#include "include/win32/fs_compat.h"
 
 // There are a few name collisions between Windows headers and Ceph.
 // Updating Ceph definitions would be the prefferable fix in order to avoid
index 2aef0b550711f3f5736b3cfb3dfb502a3fd9071e..7c9943cccb4c0d9f971b22d851baea0c69ed1ea1 100644 (file)
 #include <vector>
 #include <thread>
 
-#ifndef ALLPERMS
-#define ALLPERMS (S_ISUID|S_ISGID|S_ISVTX|S_IRWXU|S_IRWXG|S_IRWXO)
-#endif
-
 TEST(LibCephFS, OpenEmptyComponent) {
 
   pid_t mypid = getpid();
index 2a5ad70e4a0263923b79de8496d62b4891eabc29..4a67c55d51a1e589d53320412f528188eb0f4848 100644 (file)
 #include <regex>
 #include <string>
 
-#ifndef ALLPERMS
-#define ALLPERMS (S_ISUID|S_ISGID|S_ISVTX|S_IRWXU|S_IRWXG|S_IRWXO)
-#endif
-
 using namespace std;
 
 TEST(LibCephFS, LayoutVerifyDefaultLayout) {