[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
sethostname tests: Avoid test failure on Cygwin
From: |
Bruno Haible |
Subject: |
sethostname tests: Avoid test failure on Cygwin |
Date: |
Wed, 20 Jan 2021 07:43:10 +0100 |
User-agent: |
KMail/5.1.3 (Linux/4.4.0-197-generic; KDE/5.18.0; x86_64; ; ) |
On Cygwin 2.9, I see this test failure:
FAIL: test-sethostname2
=======================
error setting valid hostname.
FAIL test-sethostname2.exe (exit status: 1)
This patch fixes it. Now the test reports
Skipping test: insufficient permissions.
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.
diff --git a/tests/test-sethostname2.c b/tests/test-sethostname2.c
index 8e5c12d..2af95f6 100644
--- a/tests/test-sethostname2.c
+++ b/tests/test-sethostname2.c
@@ -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;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- sethostname tests: Avoid test failure on Cygwin,
Bruno Haible <=