]> granicus.if.org Git - strace/commitdiff
tests: fix accept4.test on systems that lack SOCK_CLOEXEC definition
authorDmitry V. Levin <ldv@altlinux.org>
Tue, 26 Jul 2016 14:09:42 +0000 (14:09 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Tue, 26 Jul 2016 15:33:22 +0000 (15:33 +0000)
* tests/accept4.c: Check that O_CLOEXEC is defined.  Use O_CLOEXEC
instead of SOCK_CLOEXEC.

tests/accept4.c

index d49eb244f239c3a1bacbbdab37cf2d93899b1a77..d26e15c5c2ca3cdf9a7b29507a07dd95eb1404c4 100644 (file)
  */
 
 #include "tests.h"
+#include <fcntl.h>
 
-#ifdef HAVE_ACCEPT4
+#if defined HAVE_ACCEPT4 && defined O_CLOEXEC
 
 # define TEST_SYSCALL_NAME accept4
-# define SUFFIX_ARGS , SOCK_CLOEXEC
+# define SUFFIX_ARGS , O_CLOEXEC
 # define SUFFIX_STR ", SOCK_CLOEXEC"
 # include "accept.c"
 
 #else
 
-SKIP_MAIN_UNDEFINED("HAVE_ACCEPT4")
+SKIP_MAIN_UNDEFINED("HAVE_ACCEPT4 && O_CLOEXEC")
 
 #endif