From: Bruno Haible Date: Mon, 2 Jun 2025 10:51:55 +0000 (+0200) Subject: open, openat: Fix test failure on native Windows. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1619b78c150e77204844e9bd04521aa59ef87e6f;p=thirdparty%2Fgnulib.git 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. --- diff --git a/ChangeLog b/ChangeLog index 9bb85638d4..51a3822484 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2025-06-02 Bruno Haible + 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. diff --git a/tests/test-open.h b/tests/test-open.h index b745a2b08d..1a80af454a 100644 --- a/tests/test-open.h +++ b/tests/test-open.h @@ -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);