summaryrefslogtreecommitdiff
path: root/src/backend
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
commit1f55a050d585db075a85d5157586c65409c89a70 (patch)
treec43272c6d7f0d7544a1ef5cc3516ce95e34239c4 /src/backend
parent1308f76ea117b1c029ae743d4e2486c0bdd95731 (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/backend')
-rw-r--r--src/backend/libpq/auth.c3
-rw-r--r--src/backend/postmaster/pgstat.c3
2 files changed, 6 insertions, 0 deletions
diff --git a/src/backend/libpq/auth.c b/src/backend/libpq/auth.c
index ded862ae31f..5838167d578 100644
--- a/src/backend/libpq/auth.c
+++ b/src/backend/libpq/auth.c
@@ -20,6 +20,9 @@
#include <netinet/in.h>
#include <arpa/inet.h>
#include <unistd.h>
+#ifdef HAVE_SYS_SELECT_H
+#include <sys/select.h>
+#endif
#include "libpq/auth.h"
#include "libpq/crypt.h"
diff --git a/src/backend/postmaster/pgstat.c b/src/backend/postmaster/pgstat.c
index 6838b3e2b1a..f9de610434f 100644
--- a/src/backend/postmaster/pgstat.c
+++ b/src/backend/postmaster/pgstat.c
@@ -28,6 +28,9 @@
#include <arpa/inet.h>
#include <signal.h>
#include <time.h>
+#ifdef HAVE_SYS_SELECT_H
+#include <sys/select.h>
+#endif
#include "pgstat.h"