<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.
#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"
#ifdef HAVE_SYS_POLL_H
#include <sys/poll.h>
#endif
+#ifdef HAVE_SYS_SELECT_H
+#include <sys/select.h>
+#endif
#include "pgstat.h"
#include <unistd.h>
#include <dirent.h>
#include <sys/stat.h>
-
+#ifdef HAVE_SYS_SELECT_H
+#include <sys/select.h>
+#endif
#ifdef HAVE_LIBZ
#include <zlib.h>
#endif
#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
#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