]> Savannah Git Hosting - gnulib.git/commitdiff
sethostname tests: Avoid test failure on Cygwin.
authorBruno Haible <bruno@clisp.org>
Wed, 20 Jan 2021 06:40:56 +0000 (07:40 +0100)
committerBruno Haible <bruno@clisp.org>
Wed, 20 Jan 2021 06:40:56 +0000 (07:40 +0100)
* tests/test-sethostname2.c (main): Treat errno EACCESS like EPERM.

ChangeLog
tests/test-sethostname2.c

index 290fa1b4cb8504e3476436d2a5e9ff987d9fb6ff..3b53236bd4371b538bfaeeec372b1e6edc2360ae 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2021-01-20  Bruno Haible  <bruno@clisp.org>
+
+       sethostname tests: Avoid test failure on Cygwin.
+       * tests/test-sethostname2.c (main): Treat errno EACCESS like EPERM.
+
 2021-01-19  Paul Eggert  <eggert@cs.ucla.edu>
 
        fnmatch, regex, fts: FALLTHROUGH consistency
index 8e5c12d52cd8e032c63ecb3a8cbebb676fc5ea79..2af95f6202d44c8782b95e7e90172e1c9f7cc0f9 100644 (file)
@@ -76,7 +76,9 @@ main (int argc, char *argv[] _GL_UNUSED)
                    "Skipping test: sethostname is not really implemented.\n");
           return 77;
         }
-      else if (rcs == -1 && errno == EPERM)
+      else if (rcs == -1
+               && (errno == EPERM
+                   || errno == EACCES)) /* Cygwin */
         {
           fprintf (stderr, "Skipping test: insufficient permissions.\n");
           return 77;