]> git.ipfire.org Git - thirdparty/gnulib.git/commitdiff
open, openat: Fix test failure on native Windows.
authorBruno Haible <bruno@clisp.org>
Mon, 2 Jun 2025 10:51:55 +0000 (12:51 +0200)
committerBruno Haible <bruno@clisp.org>
Mon, 2 Jun 2025 10:51:55 +0000 (12:51 +0200)
* tests/test-open.h (test_open): Expect a different error code for
"/dev/null/" on native Windows.

ChangeLog
tests/test-open.h

index 9bb85638d49692be554db0befcfb13d1c62604c3..51a3822484c75f7d2691c847395cedddd12a7744 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2025-06-02  Bruno Haible  <bruno@clisp.org>
 
+       open, openat: Fix test failure on native Windows.
+       * tests/test-open.h (test_open): Expect a different error code for
+       "/dev/null/" on native Windows.
+
        open: Fix syntax error on native Windows (regression 2025-05-28).
        * lib/open.c (open): Add missing parenthesis.
 
index b745a2b08dfc75f9b940c7673fba458a17dc1f55..1a80af454a620259cc6735ad50a25cd66d673845 100644 (file)
@@ -86,7 +86,11 @@ test_open (int (*func) (char const *, int, ...), bool print)
   /* Cannot open /dev/null with trailing slash or O_DIRECTORY.  */
   errno = 0;
   ASSERT (func ("/dev/null/", O_RDONLY) == -1);
+#if defined _WIN32 && !defined __CYGWIN__
+  ASSERT (errno == ENOENT);
+#else
   ASSERT (errno == ENOTDIR || errno == EISDIR || errno == EINVAL);
+#endif
 
   errno = 0;
   ASSERT (func ("/dev/null", O_RDONLY | O_DIRECTORY) == -1);