summaryrefslogtreecommitdiff
path: root/src/bin
diff options
context:
space:
mode:
authorAlvaro Herrera <alvherre@alvh.no-ip.org>2016-09-27 01:05:21 -0300
committerAlvaro Herrera <alvherre@alvh.no-ip.org>2016-09-27 01:05:21 -0300
commitce7b35e7e828b1f7d0e3835f84e81f3b8646f17c (patch)
treeb6103f6c699c2066c47526c51b74e3debe5f9be7 /src/bin
parent0b48e33403f7a85107dc9d319cccdba7e8ec1fe8 (diff)
Include <sys/select.h> where needed
<sys/select.h> 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.
Diffstat (limited to 'src/bin')
-rw-r--r--src/bin/pg_basebackup/pg_basebackup.c4
-rw-r--r--src/bin/pg_basebackup/pg_recvlogical.c3
-rw-r--r--src/bin/pg_basebackup/receivelog.c3
-rw-r--r--src/bin/pg_dump/parallel.c4
4 files changed, 13 insertions, 1 deletions
diff --git a/src/bin/pg_basebackup/pg_basebackup.c b/src/bin/pg_basebackup/pg_basebackup.c
index 204ceccb456..ed78d09dd8f 100644
--- a/src/bin/pg_basebackup/pg_basebackup.c
+++ b/src/bin/pg_basebackup/pg_basebackup.c
@@ -20,7 +20,9 @@
#include <sys/wait.h>
#include <signal.h>
#include <time.h>
-
+#ifdef HAVE_SYS_SELECT_H
+#include <sys/select.h>
+#endif
#ifdef HAVE_LIBZ
#include <zlib.h>
#endif
diff --git a/src/bin/pg_basebackup/pg_recvlogical.c b/src/bin/pg_basebackup/pg_recvlogical.c
index 545103be146..16f755c6ec4 100644
--- a/src/bin/pg_basebackup/pg_recvlogical.c
+++ b/src/bin/pg_basebackup/pg_recvlogical.c
@@ -15,6 +15,9 @@
#include <dirent.h>
#include <sys/stat.h>
#include <unistd.h>
+#ifdef HAVE_SYS_SELECT_H
+#include <sys/select.h>
+#endif
/* local includes */
#include "streamutil.h"
diff --git a/src/bin/pg_basebackup/receivelog.c b/src/bin/pg_basebackup/receivelog.c
index 660116dcec5..33ecf20ed45 100644
--- a/src/bin/pg_basebackup/receivelog.c
+++ b/src/bin/pg_basebackup/receivelog.c
@@ -16,6 +16,9 @@
#include <sys/stat.h>
#include <unistd.h>
+#ifdef HAVE_SYS_SELECT_H
+#include <sys/select.h>
+#endif
/* local includes */
#include "receivelog.h"
diff --git a/src/bin/pg_dump/parallel.c b/src/bin/pg_dump/parallel.c
index 5f9f8a33ac2..e73a16e7cdd 100644
--- a/src/bin/pg_dump/parallel.c
+++ b/src/bin/pg_dump/parallel.c
@@ -59,6 +59,10 @@
#include "postgres_fe.h"
+#ifdef HAVE_SYS_SELECT_H
+#include <sys/select.h>
+#endif
+
#include "pg_backup_utils.h"
#include "parallel.h"