]> Savannah Git Hosting - gnulib.git/commitdiff
chown, lchown tests: Fix link error on mingw 10.
authorBruno Haible <bruno@clisp.org>
Thu, 20 Apr 2023 00:51:43 +0000 (02:51 +0200)
committerBruno Haible <bruno@clisp.org>
Thu, 20 Apr 2023 00:51:43 +0000 (02:51 +0200)
* 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
modules/lchown-tests
tests/test-lchown.h

index 639f3e2923eb0bac248de69fa6735b7d3958ff7b..163a8e573aa8cb8c1025f2b8f965892a88db042c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,9 +1,11 @@
 2023-04-19  Bruno Haible  <bruno@clisp.org>
 
-       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  <bruno@clisp.org>
 
index 10119f22eb1988a2a4392e9f5fc21ed4593b253c..2954701eeb456e5dd1ef28ec0ae9eae2dfc5e6b2 100644 (file)
@@ -16,7 +16,7 @@ stdbool
 symlink
 
 configure.ac:
-AC_CHECK_FUNCS_ONCE([getegid])
+AC_CHECK_FUNCS_ONCE([getgid getegid])
 
 Makefile.am:
 TESTS += test-lchown
index 1c68f4a1bad4823b04ad3e7559b37af82877c301..3f5d0bc54c2ebde2e3ba4dbb9434eca4535e3d47 100644 (file)
 
 #include "nap.h"
 
+#if !HAVE_GETGID
+# define getgid() ((gid_t) -1)
+#endif
+
 #if !HAVE_GETEGID
 # define getegid() ((gid_t) -1)
 #endif