Include where needed
authorAlvaro Herrera
Tue, 27 Sep 2016 04:05:21 +0000 (01:05 -0300)
committerAlvaro Herrera
Tue, 27 Sep 2016 04:05:21 +0000 (01:05 -0300)
 is required by POSIX.1-2001 to get the prototype of
select(2), but nearly no systems enforce that because older standards
let you get away with including some other headers.  Recent OpenBSD
hacking has removed that frail touch of friendliness, however, which
broke some compiles; fix all the way back to 9.1 by adding the required
standard.  Only vacuumdb.c was reported to fail, but it seems easier to
fix the whole lot in a fell swoop.

Per bug #14334 by Sean Farrell.

src/backend/libpq/auth.c
src/backend/postmaster/pgstat.c
src/bin/pg_basebackup/pg_basebackup.c
src/bin/pg_basebackup/receivelog.c
src/bin/pg_dump/parallel.c
src/port/pgsleep.c
src/test/examples/testlibpq2.c

index ded862ae31fad52864832d740a1abcfbcd95c084..5838167d5786b7ed7ccc1a724997e790bc53fac5 100644 (file)
@@ -20,6 +20,9 @@
 #include 
 #include 
 #include 
+#ifdef HAVE_SYS_SELECT_H
+#include 
+#endif
 
 #include "libpq/auth.h"
 #include "libpq/crypt.h"
index 6838b3e2b1aade0ed91b1b57301583de891fb31d..f9de610434ff64e41133ebfce719caf9deea4b0f 100644 (file)
@@ -28,6 +28,9 @@
 #include 
 #include 
 #include 
+#ifdef HAVE_SYS_SELECT_H
+#include 
+#endif
 
 #include "pgstat.h"
 
index 176101ffd154f1b5cfcead069e45d9891edffa7b..94686fdc8adcb79f4ba4874e9db314b8f8a207a1 100644 (file)
@@ -23,7 +23,9 @@
 #include 
 #include 
 #include 
-
+#ifdef HAVE_SYS_SELECT_H
+#include 
+#endif
 #ifdef HAVE_LIBZ
 #include 
 #endif
index e1bd4ad04ddf21bd6bb9249b70554d4d42d1a449..49ae0a598cec34f9a5f0ada5c0437ee37b5d2f9d 100644 (file)
@@ -20,6 +20,9 @@
 /* for ntohl/htonl */
 #include 
 #include 
+#ifdef HAVE_SYS_SELECT_H
+#include 
+#endif
 
 #include "libpq-fe.h"
 #include "access/xlog_internal.h"
index 304c8a8645729af9157c516f70dc1f74303cb946..b293ff548bbe7bb2589e742af8c9555c8e67f05d 100644 (file)
 
 #include "postgres_fe.h"
 
+#ifdef HAVE_SYS_SELECT_H
+#include 
+#endif
+
 #include "pg_backup_utils.h"
 #include "parallel.h"
 
index 1e2c74dbab8d8ad8034638c4be8e6673ea499b21..cde30d2916ce6a77d11f522c28b7f720eab426e8 100644 (file)
@@ -14,6 +14,9 @@
 
 #include 
 #include 
+#ifdef HAVE_SYS_SELECT_H
+#include 
+#endif
 
 /*
  * In a Windows backend, we don't use this implementation, but rather
index 850993f6e82af05ac72dfbc4936307f8b3b63bd1..07c6317a2123dd3b7808bef9895bd35bb9a9cf0e 100644 (file)
 #include 
 #include 
 #include 
+#ifdef HAVE_SYS_SELECT_H
+#include 
+#endif
+
 #include "libpq-fe.h"
 
 static void