From e23d55dfc7c8ac9471e922dac2901e45103c4def Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Thu, 20 Apr 2023 02:29:26 +0200 Subject: [PATCH] chown tests: Fix link error on mingw 10. * modules/chown-tests (configure.ac): Test whether getgid() exists. * modules/lchown-tests (configure.ac): Likewise. * modules/fchownat-tests (configure.ac): Likewise. * tests/test-chown.h (getgid): Define a fallback. * tests/test-lchown.h (getgid): Likewise. --- ChangeLog | 9 +++++++++ modules/chown-tests | 2 +- modules/fchownat-tests | 2 +- modules/lchown-tests | 2 +- tests/test-chown.h | 4 ++++ tests/test-lchown.h | 4 ++++ 6 files changed, 20 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0751af3fa5..5c6ca2dea3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2023-04-19 Bruno Haible + + chown, lchown tests: Fix link error on mingw 10. + * modules/chown-tests (configure.ac): Test whether getgid() exists. + * modules/lchown-tests (configure.ac): Likewise. + * modules/fchownat-tests (configure.ac): Likewise. + * tests/test-chown.h (getgid): Define a fallback. + * tests/test-lchown.h (getgid): Likewise. + 2023-04-19 Bruno Haible ctime: Fix compilation errors in C++ mode on mingw 10. diff --git a/modules/chown-tests b/modules/chown-tests index 1bd6744067..b12a0d6a18 100644 --- a/modules/chown-tests +++ b/modules/chown-tests @@ -16,7 +16,7 @@ stdckdint symlink configure.ac: -AC_CHECK_FUNCS_ONCE([getegid]) +AC_CHECK_FUNCS_ONCE([getgid getegid]) Makefile.am: TESTS += test-chown diff --git a/modules/fchownat-tests b/modules/fchownat-tests index f0e4cea78c..31b5b9f5a7 100644 --- a/modules/fchownat-tests +++ b/modules/fchownat-tests @@ -17,7 +17,7 @@ stdckdint symlink configure.ac: -AC_CHECK_FUNCS_ONCE([getegid]) +AC_CHECK_FUNCS_ONCE([getgid getegid]) Makefile.am: TESTS += test-fchownat diff --git a/modules/lchown-tests b/modules/lchown-tests index edd0cc7c21..56c01082ab 100644 --- a/modules/lchown-tests +++ b/modules/lchown-tests @@ -16,7 +16,7 @@ stdbool symlink configure.ac: -AC_CHECK_FUNCS_ONCE([getegid]) +AC_CHECK_FUNCS_ONCE([getgid getegid]) Makefile.am: TESTS += test-lchown diff --git a/tests/test-chown.h b/tests/test-chown.h index 4c7b6eec33..4e3d417d1b 100644 --- a/tests/test-chown.h +++ b/tests/test-chown.h @@ -18,6 +18,10 @@ #include "nap.h" +#if !HAVE_GETGID +# define getgid() ((gid_t) -1) +#endif + #if !HAVE_GETEGID # define getegid() ((gid_t) -1) #endif diff --git a/tests/test-lchown.h b/tests/test-lchown.h index 1c68f4a1ba..3f5d0bc54c 100644 --- a/tests/test-lchown.h +++ b/tests/test-lchown.h @@ -18,6 +18,10 @@ #include "nap.h" +#if !HAVE_GETGID +# define getgid() ((gid_t) -1) +#endif + #if !HAVE_GETEGID # define getegid() ((gid_t) -1) #endif -- 2.39.5