From: Collin Funk Date: Sun, 16 Feb 2025 20:29:36 +0000 (-0800) Subject: unistd-h tests: Check that unistd.h defines O_CLOEXEC. X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=3b564fec28458688de4337ee5627568ce4dc78b9;p=gnulib.git unistd-h tests: Check that unistd.h defines O_CLOEXEC. * tests/test-unistd-h.c: Prefer #error to emitting a syntax error. Check that O_CLOEXEC is defined. --- diff --git a/ChangeLog b/ChangeLog index de21277abe..ba22c1571a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2025-02-16 Collin Funk + unistd-h tests: Check that unistd.h defines O_CLOEXEC. + * tests/test-unistd-h.c: Prefer #error to emitting a syntax error. Check + that O_CLOEXEC is defined. + unistd-h: Make sure O_CLOEXEC is defined. * modules/unistd-h (Depends-on): Add fcntl-h. * lib/unistd.in.h: Include fcntl.h if inclusion of unistd.h does not diff --git a/tests/test-unistd-h.c b/tests/test-unistd-h.c index d7173956df..fa86969583 100644 --- a/tests/test-unistd-h.c +++ b/tests/test-unistd-h.c @@ -30,7 +30,11 @@ int sk[] = { SEEK_CUR, SEEK_END, SEEK_SET }; /* Check that the various *_FILENO macros are defined. */ #if ! (defined STDIN_FILENO \ && (STDIN_FILENO + STDOUT_FILENO + STDERR_FILENO == 3)) -missing or broken *_FILENO macros +# error "missing or broken *_FILENO macros" +#endif + +#ifndef O_CLOEXEC +# error "O_CLOEXEC is not defined" #endif /* Check that the types are all defined. */