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  by Sean Farrell.
This commit is contained in:
Alvaro Herrera 2016-09-27 01:05:21 -03:00
parent 440c8d1bbc
commit 51c3e9fade
9 changed files with 30 additions and 1 deletions
src
backend
libpq
postmaster
bin
port
test/examples

@ -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 "common/ip.h"
#include "common/md5.h"

@ -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"

@ -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

@ -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"

@ -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"

@ -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"
#include "fe_utils/string_utils.h"

@ -12,6 +12,10 @@
#include "postgres_fe.h"
#ifdef HAVE_SYS_SELECT_H
#include <sys/select.h>
#endif
#include "common.h"
#include "fe_utils/simple_list.h"
#include "fe_utils/string_utils.h"

@ -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

@ -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