From: Lucian Petrut Date: Thu, 30 Mar 2023 12:14:10 +0000 (+0000) Subject: include: move ALLPERMS definition to compat.h X-Git-Tag: v19.0.0~1469^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=a2966c08171e006acfd9c32b00a1294f428c7e62;p=ceph-ci.git include: move ALLPERMS definition to compat.h 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 --- diff --git a/src/include/compat.h b/src/include/compat.h index 517e9d4fcd5..c65a6ae4465 100644 --- a/src/include/compat.h +++ b/src/include/compat.h @@ -28,10 +28,19 @@ #endif #include + +#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 #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 diff --git a/src/test/libcephfs/test.cc b/src/test/libcephfs/test.cc index 118a6e2f270..57c5eefa6d3 100644 --- a/src/test/libcephfs/test.cc +++ b/src/test/libcephfs/test.cc @@ -43,10 +43,6 @@ #include #include -#ifndef ALLPERMS -#define ALLPERMS (S_ISUID|S_ISGID|S_ISVTX|S_IRWXU|S_IRWXG|S_IRWXO) -#endif - using namespace std; TEST(LibCephFS, OpenEmptyComponent) { diff --git a/src/test/libcephfs/vxattr.cc b/src/test/libcephfs/vxattr.cc index 2d06ae180d9..4d9eaf5e4d0 100644 --- a/src/test/libcephfs/vxattr.cc +++ b/src/test/libcephfs/vxattr.cc @@ -47,10 +47,6 @@ #include #include -#ifndef ALLPERMS -#define ALLPERMS (S_ISUID|S_ISGID|S_ISVTX|S_IRWXU|S_IRWXG|S_IRWXO) -#endif - using namespace std; TEST(LibCephFS, LayoutVerifyDefaultLayout) {