]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[testsuite] [analyzer] include sys/select.h if available
authorAlexandre Oliva <oliva@adacore.com>
Thu, 18 Apr 2024 11:01:21 +0000 (08:01 -0300)
committerAlexandre Oliva <oliva@gnu.org>
Thu, 18 Apr 2024 11:11:42 +0000 (08:11 -0300)
Test that calls select fails on vxworks because select is only
declared in sys/select.h.  Include that header if it's present.

for  gcc/testsuite/ChangeLog

* gcc.dg/analyzer/fd-glibc-byte-stream-connection-server.c:
Include sys/select.h if present.

gcc/testsuite/gcc.dg/analyzer/fd-glibc-byte-stream-connection-server.c

index fcbcc740170e67201d7efc867ff08532d7eb8713..f922a52238f90b22a5eb69cfc3ac4a2183b56ae1 100644 (file)
@@ -8,6 +8,9 @@
 #include <stdlib.h>
 #include <unistd.h>
 #include <sys/types.h>
+#if __has_include(<sys/select.h>)
+#include <sys/select.h>
+#endif
 #include <sys/socket.h>
 #include <netinet/in.h>
 #include <arpa/inet.h>