From e5eacca5e2ee869d6e622f54d9a0309bc87f8254 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Thu, 20 Apr 2023 02:51:43 +0200 Subject: 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. --- ChangeLog | 4 +++- modules/lchown-tests | 2 +- tests/test-lchown.h | 4 ++++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 639f3e2923..163a8e573a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,9 +1,11 @@ 2023-04-19 Bruno Haible - chown tests: Fix link error on mingw 10. + 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 diff --git a/modules/lchown-tests b/modules/lchown-tests index 10119f22eb..2954701eeb 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-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 -- cgit v1.2.1