diff options
author | Alvaro Herrera <alvherre@alvh.no-ip.org> | 2016-09-27 01:05:21 -0300 |
---|---|---|
committer | Alvaro Herrera <alvherre@alvh.no-ip.org> | 2016-09-27 01:05:21 -0300 |
commit | 8d11c303d01087186605d7ea53bfc4b7f53725f4 (patch) | |
tree | e42809e54ba3fb69bc8f8e4acdfbd251b5aa4017 /src | |
parent | 1e903c2f00f8b94ae34a8503f63e37b2963eb2cf (diff) | |
download | postgresql-8d11c303d01087186605d7ea53bfc4b7f53725f4.tar.gz postgresql-8d11c303d01087186605d7ea53bfc4b7f53725f4.zip |
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')
-rw-r--r-- | src/backend/libpq/auth.c | 3 | ||||
-rw-r--r-- | src/backend/postmaster/pgstat.c | 3 | ||||
-rw-r--r-- | src/bin/pg_basebackup/pg_basebackup.c | 4 | ||||
-rw-r--r-- | src/bin/pg_basebackup/pg_recvlogical.c | 3 | ||||
-rw-r--r-- | src/bin/pg_basebackup/receivelog.c | 3 | ||||
-rw-r--r-- | src/bin/pg_dump/parallel.c | 4 | ||||
-rw-r--r-- | src/bin/scripts/vacuumdb.c | 4 | ||||
-rw-r--r-- | src/port/pgsleep.c | 3 | ||||
-rw-r--r-- | src/test/examples/testlibpq2.c | 4 |
9 files changed, 30 insertions, 1 deletions
diff --git a/src/backend/libpq/auth.c b/src/backend/libpq/auth.c index dd8d2e9ff39..936a7ccae57 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 3c862feb927..0440f4a1d45 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" diff --git a/src/bin/pg_basebackup/pg_basebackup.c b/src/bin/pg_basebackup/pg_basebackup.c index 84eef6466d7..fd93a3bc09e 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 73625256aca..5907d607b09 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 f8bd551ef95..406c01bfccc 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 51a8eee369d..ce3a06ae816 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 "parallel.h" #include "pg_backup_utils.h" diff --git a/src/bin/scripts/vacuumdb.c b/src/bin/scripts/vacuumdb.c index f99be3bf7a1..2125f42c99d 100644 --- a/src/bin/scripts/vacuumdb.c +++ b/src/bin/scripts/vacuumdb.c @@ -12,6 +12,10 @@ #include "postgres_fe.h" +#ifdef HAVE_SYS_SELECT_H +#include <sys/select.h> +#endif + #include "common.h" #include "dumputils.h" diff --git a/src/port/pgsleep.c b/src/port/pgsleep.c index 89a12b9da7c..3f84d8f2409 100644 --- a/src/port/pgsleep.c +++ b/src/port/pgsleep.c @@ -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 diff --git a/src/test/examples/testlibpq2.c b/src/test/examples/testlibpq2.c index 850993f6e82..07c6317a212 100644 --- a/src/test/examples/testlibpq2.c +++ b/src/test/examples/testlibpq2.c @@ -34,6 +34,10 @@ #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 |