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/pg_recvlogical.c
src/bin/pg_basebackup/receivelog.c
src/bin/pg_dump/parallel.c
src/bin/scripts/vacuumdb.c
src/port/pgsleep.c
src/test/examples/testlibpq2.c

index dd8d2e9ff3995c253686d7a559ca63b27b3d5204..936a7ccae570aabeb087d645beaa71eaac9f8786 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 3c862feb92767e1b66613adcbef90513aabd77e9..0440f4a1d453ef77bb0830837e698bfbd1b13f5a 100644 (file)
@@ -28,6 +28,9 @@
 #include 
 #include 
 #include 
+#ifdef HAVE_SYS_SELECT_H
+#include 
+#endif
 
 #include "pgstat.h"
 
index 84eef6466d7682224273ab178c62dc41ce16b7e4..fd93a3bc09ee6d9cf84b7ff5da4ca485fc92adc7 100644 (file)
@@ -20,7 +20,9 @@
 #include 
 #include 
 #include 
-
+#ifdef HAVE_SYS_SELECT_H
+#include 
+#endif
 #ifdef HAVE_LIBZ
 #include 
 #endif
index 73625256acab26cd630d5b65db962b33b84d7b3c..5907d607b094d3868c891dd53d2c89f5d3af1189 100644 (file)
@@ -15,6 +15,9 @@
 #include 
 #include 
 #include 
+#ifdef HAVE_SYS_SELECT_H
+#include 
+#endif
 
 /* local includes */
 #include "streamutil.h"
index f8bd551ef959042fa80a5394d8d201111e7f4fd0..406c01bfccc83fe7660bac001b095dd6e158f274 100644 (file)
@@ -16,6 +16,9 @@
 
 #include 
 #include 
+#ifdef HAVE_SYS_SELECT_H
+#include 
+#endif
 
 /* local includes */
 #include "receivelog.h"
index 51a8eee369db710f2d8c56896ac1aa3073ab81e3..ce3a06ae816ba2cd8df29f317e2f2935e9352a18 100644 (file)
 
 #include "postgres_fe.h"
 
+#ifdef HAVE_SYS_SELECT_H
+#include 
+#endif
+
 #include "parallel.h"
 #include "pg_backup_utils.h"
 
index f99be3bf7a159a09cfa960427326bca45f7e1886..2125f42c99d47c1fceaf7cb9edab00e88528427c 100644 (file)
 
 #include "postgres_fe.h"
 
+#ifdef HAVE_SYS_SELECT_H
+#include 
+#endif
+
 #include "common.h"
 #include "dumputils.h"
 
index 89a12b9da7c451e25053f6fc818844eede8b5a34..3f84d8f24097e5bf55309ddf8a2e99cc12162656 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