]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
include: move ALLPERMS definition to compat.h 50793/head
authorLucian Petrut <lpetrut@cloudbasesolutions.com>
Thu, 30 Mar 2023 12:14:10 +0000 (12:14 +0000)
committerLucian Petrut <lpetrut@cloudbasesolutions.com>
Fri, 31 Mar 2023 07:09:37 +0000 (07:09 +0000)
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>
src/include/compat.h
src/test/libcephfs/test.cc
src/test/libcephfs/vxattr.cc

index 517e9d4fcd5f051a729e8287eb980148155445ec..c65a6ae4465aed486ee8c1d9043b058d9669324d 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
@@ -233,7 +242,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 118a6e2f270caf64637adcd6df92c53b94c5ab2b..57c5eefa6d3283fea50c51dc18cd23c91b66b298 100644 (file)
 #include <thread>
 #include <regex>
 
-#ifndef ALLPERMS
-#define ALLPERMS (S_ISUID|S_ISGID|S_ISVTX|S_IRWXU|S_IRWXG|S_IRWXO)
-#endif
-
 using namespace std;
 
 TEST(LibCephFS, OpenEmptyComponent) {
index 2d06ae180d9e0e19418443ad31017eb2b7841ca2..4d9eaf5e4d0cd8a69f8886453b6c9834be7748a0 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) {