From ffb0b29997c66526985e1f4a496335d0ab4ef111 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Fri, 10 Sep 2010 11:55:27 -0700 Subject: fcntl-h: define O_CLOEXEC and O_EXEC if not defined; use new defines * doc/posix-headers/fcntl.texi (fcntl.h): Document that O_CLOEXEC is now defined to 0 if it is not defined, like other flags. Also, O_EXEC is now defined to be O_RDONLY if O_EXEC is not defined. Similarly for O_SEARCH; this last was already true, but not documented. * lib/fcntl.in.h (O_CLOEXEC): Define to 0 if not defined. * lib/dup-safer-flag.c (O_CLOEXEC): Remove now-useless #define. * lib/dup3.c, lib/pipe2.c, tests/test-dup-safer.c, tests/test-fcntl.c: Likewise. * lib/popen-safer.c (open_noinherit): Check whether O_CLOEXEC is zero, not whether it is defined. * tests/test-dup3.c, tests/test-pipe2.c (main): Likewise. * lib/progreloc.c (find_executable): Use O_EXEC rather than O_RDONLY. * lib/open.c (open): Check for O_SEARCH as well as for O_RDONLY. --- lib/dup3.c | 7 ------- 1 file changed, 7 deletions(-) (limited to 'lib/dup3.c') diff --git a/lib/dup3.c b/lib/dup3.c index d44aa92b01..5ae8b44ea8 100644 --- a/lib/dup3.c +++ b/lib/dup3.c @@ -38,13 +38,6 @@ /* Upper bound on getdtablesize(). See lib/getdtablesize.c. */ # define OPEN_MAX_MAX 0x10000 -#else -/* Unix API. */ - -# ifndef O_CLOEXEC -# define O_CLOEXEC 0 -# endif - #endif int -- cgit v1.2.1