From b3774862952b27e3513b3ef82414d56bcae3b665 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Thu, 20 Apr 2023 02:29:26 +0200 Subject: chown tests: Fix link error on mingw 10. * modules/chown-tests (configure.ac): Test whether getgid() exists. * modules/fchownat-tests (configure.ac): Likewise. * tests/test-chown.h (getgid): Define a fallback. --- ChangeLog | 7 +++++++ modules/chown-tests | 2 +- modules/fchownat-tests | 2 +- tests/test-chown.h | 4 ++++ 4 files changed, 13 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index fbc1812489..639f3e2923 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2023-04-19 Bruno Haible + + chown tests: Fix link error on mingw 10. + * modules/chown-tests (configure.ac): Test whether getgid() exists. + * modules/fchownat-tests (configure.ac): Likewise. + * tests/test-chown.h (getgid): Define a fallback. + 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 1fa6e44bc7..d013be17e7 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 f498efaf66..f11d02cdde 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/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 -- cgit v1.2.1