Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit f0631bd

Browse files
committed
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.
1 parent a721a1b commit f0631bd

File tree

9 files changed

+30
-1
lines changed

9 files changed

+30
-1
lines changed

src/backend/libpq/auth.c

+3
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@
2020
#include <netinet/in.h>
2121
#include <arpa/inet.h>
2222
#include <unistd.h>
23+
#ifdef HAVE_SYS_SELECT_H
24+
#include <sys/select.h>
25+
#endif
2326

2427
#include "libpq/auth.h"
2528
#include "libpq/crypt.h"

src/backend/postmaster/pgstat.c

+3
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@
2828
#include <arpa/inet.h>
2929
#include <signal.h>
3030
#include <time.h>
31+
#ifdef HAVE_SYS_SELECT_H
32+
#include <sys/select.h>
33+
#endif
3134

3235
#include "pgstat.h"
3336

src/bin/pg_basebackup/pg_basebackup.c

+3-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@
2020
#include <sys/wait.h>
2121
#include <signal.h>
2222
#include <time.h>
23-
23+
#ifdef HAVE_SYS_SELECT_H
24+
#include <sys/select.h>
25+
#endif
2426
#ifdef HAVE_LIBZ
2527
#include <zlib.h>
2628
#endif

src/bin/pg_basebackup/pg_recvlogical.c

+3
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@
1515
#include <dirent.h>
1616
#include <sys/stat.h>
1717
#include <unistd.h>
18+
#ifdef HAVE_SYS_SELECT_H
19+
#include <sys/select.h>
20+
#endif
1821

1922
/* local includes */
2023
#include "streamutil.h"

src/bin/pg_basebackup/receivelog.c

+3
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@
1616

1717
#include <sys/stat.h>
1818
#include <unistd.h>
19+
#ifdef HAVE_SYS_SELECT_H
20+
#include <sys/select.h>
21+
#endif
1922

2023
/* local includes */
2124
#include "receivelog.h"

src/bin/pg_dump/parallel.c

+4
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,10 @@
5959

6060
#include "postgres_fe.h"
6161

62+
#ifdef HAVE_SYS_SELECT_H
63+
#include <sys/select.h>
64+
#endif
65+
6266
#include "parallel.h"
6367
#include "pg_backup_utils.h"
6468
#include "fe_utils/string_utils.h"

src/bin/scripts/vacuumdb.c

+4
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@
1212

1313
#include "postgres_fe.h"
1414

15+
#ifdef HAVE_SYS_SELECT_H
16+
#include <sys/select.h>
17+
#endif
18+
1519
#include "common.h"
1620
#include "fe_utils/simple_list.h"
1721
#include "fe_utils/string_utils.h"

src/port/pgsleep.c

+3
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@
1414

1515
#include <unistd.h>
1616
#include <sys/time.h>
17+
#ifdef HAVE_SYS_SELECT_H
18+
#include <sys/select.h>
19+
#endif
1720

1821
/*
1922
* In a Windows backend, we don't use this implementation, but rather

src/test/examples/testlibpq2.c

+4
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@
3434
#include <errno.h>
3535
#include <sys/time.h>
3636
#include <sys/types.h>
37+
#ifdef HAVE_SYS_SELECT_H
38+
#include <sys/select.h>
39+
#endif
40+
3741
#include "libpq-fe.h"
3842

3943
static void

0 commit comments

Comments
 (0)