]> granicus.if.org Git - sudo/commitdiff
AIX 7.1 defines O_CLOEXEC but it can't be used outside the kernel.
authorTodd C. Miller <Todd.Miller@sudo.ws>
Mon, 18 Feb 2019 22:45:31 +0000 (15:45 -0700)
committerTodd C. Miller <Todd.Miller@sudo.ws>
Mon, 18 Feb 2019 22:45:31 +0000 (15:45 -0700)
Redefine O_CLOEXEC if it doesn't fit in an int and pipe2() is missing.

include/sudo_compat.h

index 5c3284014bb3dbae5206e0427aea077571cb1089..0555b0f422854ca699457b87239e17c0d505386f 100644 (file)
 #endif
 
 /* For pipe2() emulation. */
-#if !defined(HAVE_PIPE2) && defined(O_NONBLOCK) && !defined(O_CLOEXEC)
+#if !defined(HAVE_PIPE2) && defined(O_NONBLOCK) && (!defined(O_CLOEXEC) || O_CLOEXEC > 0xffffffff)
+# undef O_CLOEXEC
 # define O_CLOEXEC     0x80000000
 #endif