chown tests: Fix link error on mingw 10.
authorBruno Haible <bruno@clisp.org>
Thu, 20 Apr 2023 00:29:26 +0000 (02:29 +0200)
committerBruno Haible <bruno@clisp.org>
Fri, 21 Apr 2023 15:25:45 +0000 (17:25 +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/chown-tests
modules/fchownat-tests
modules/lchown-tests
tests/test-chown.h
tests/test-lchown.h

index 87dd03628f45389692cc12c3f9ff8c1d7f139a54..4960e5530553b78def6d6d84d84228963a35a53c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2023-04-19  Bruno Haible  <bruno@clisp.org>
+
+       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>
 
        random: Fix compilation errors in C++ mode on mingw 10.
index 13138f438b568a798451a716e6b6488b145c20eb..f24bc87ccb7436478b294e5dd0e0d7e208a4c5ff 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-chown
index e5fb7833f408a785a4be167a17703d207a3ac330..8b78efcedf9cbdd4893e7009690dcd088b79cb72 100644 (file)
@@ -17,7 +17,7 @@ stat-time
 symlink
 
 configure.ac:
-AC_CHECK_FUNCS_ONCE([getegid])
+AC_CHECK_FUNCS_ONCE([getgid getegid])
 
 Makefile.am:
 TESTS += test-fchownat
index 42b946014c12603317a3adb91f81d985f412b825..f02aa87f7149e134673292cbb877b9f4c7a90e20 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 4c7b6eec33fd2206a404daa05227ca2f381e72f1..4e3d417d1bb6b26eff9383f17217b5550744651a 100644 (file)
 
 #include "nap.h"
 
+#if !HAVE_GETGID
+# define getgid() ((gid_t) -1)
+#endif
+
 #if !HAVE_GETEGID
 # define getegid() ((gid_t) -1)
 #endif
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