]> granicus.if.org Git - postgresql/commitdiff
Include <sys/select.h> where needed
authorAlvaro Herrera <alvherre@alvh.no-ip.org>
Tue, 27 Sep 2016 04:05:21 +0000 (01:05 -0300)
committerAlvaro Herrera <alvherre@alvh.no-ip.org>
Tue, 27 Sep 2016 04:05:21 +0000 (01:05 -0300)
<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.

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

index 51d167fdfc0848404223b4125ffea2d8c89e76cf..e5f848ec1b42de1559852ff77818ab5301a7f0c5 100644 (file)
@@ -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"
index ef865174ecb8fa955b8d1d4d12bf1c747c40d8d4..38f7e70d0a77c5853b82558f2f58ffa7902ce39f 100644 (file)
@@ -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"
 
index 1140e766bf0c47570e0dbd0b14771ff4090bdfc2..6b88b734ada675b92e872842ffac8f74c732eb63 100644 (file)
@@ -27,7 +27,9 @@
 #include <sys/types.h>
 #include <sys/wait.h>
 #include <signal.h>
-
+#ifdef HAVE_SYS_SELECT_H
+#include <sys/select.h>
+#endif
 #ifdef HAVE_LIBZ
 #include <zlib.h>
 #endif
index b7f43d5aef0ec480097b36e29f55b57c2001dec0..2e0b52cefb4409bcad93f398550e777e69cb6e80 100644 (file)
@@ -32,6 +32,9 @@
 #include <sys/time.h>
 #include <sys/types.h>
 #include <unistd.h>
+#ifdef HAVE_SYS_SELECT_H
+#include <sys/select.h>
+#endif
 
 
 /* Size of the streaming replication protocol headers */
index 0ebeb6528f09e6e641fe8e4f1c96cdc93e36708f..96d467ef8b3a8fe153c04da7986867fc75c5b6f7 100644 (file)
@@ -14,6 +14,9 @@
 
 #include <unistd.h>
 #include <sys/time.h>
+#ifdef HAVE_SYS_SELECT_H
+#include <sys/select.h>
+#endif
 
 /*
  * In a Windows backend, we don't use this implementation, but rather
index 850993f6e82af05ac72dfbc4936307f8b3b63bd1..07c6317a2123dd3b7808bef9895bd35bb9a9cf0e 100644 (file)
 #include <errno.h>
 #include <sys/time.h>
 #include <sys/types.h>
+#ifdef HAVE_SYS_SELECT_H
+#include <sys/select.h>
+#endif
+
 #include "libpq-fe.h"
 
 static void