Skip to content

Commit 8ae0a37

Browse files
oauth: Fix build on platforms without epoll/kqueue
register_socket() missed a variable declaration if neither HAVE_SYS_EPOLL_H nor HAVE_SYS_EVENT_H was defined. While we're fixing that, adjust the tests to check pg_config.h for one of the multiplexer implementations, rather than assuming that Windows is the only platform without support. (Christoph reported this on hurd-amd64, an experimental Debian.) Author: Jacob Champion <jacob.champion@enterprisedb.com> Reported-by: Christoph Berg <myon@debian.org> Discussion: https://postgr.es/m/Z-sPFl27Y0ZC-VBl%40msg.df7cb.de
1 parent 9451262 commit 8ae0a37

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

src/interfaces/libpq/fe-auth-oauth-curl.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1172,8 +1172,9 @@ static int
11721172
register_socket(CURL *curl, curl_socket_t socket, int what, void *ctx,
11731173
void *socketp)
11741174
{
1175-
#ifdef HAVE_SYS_EPOLL_H
11761175
struct async_ctx *actx = ctx;
1176+
1177+
#ifdef HAVE_SYS_EPOLL_H
11771178
struct epoll_event ev = {0};
11781179
int res;
11791180
int op = EPOLL_CTL_ADD;
@@ -1231,7 +1232,6 @@ register_socket(CURL *curl, curl_socket_t socket, int what, void *ctx,
12311232
return 0;
12321233
#endif
12331234
#ifdef HAVE_SYS_EVENT_H
1234-
struct async_ctx *actx = ctx;
12351235
struct kevent ev[2] = {0};
12361236
struct kevent ev_out[2];
12371237
struct timespec timeout = {0};

src/test/modules/oauth_validator/t/001_server.pl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,11 @@
2626
'Potentially unsafe test oauth not enabled in PG_TEST_EXTRA';
2727
}
2828

29-
if ($windows_os)
29+
unless (check_pg_config("#define HAVE_SYS_EVENT_H 1")
30+
or check_pg_config("#define HAVE_SYS_EPOLL_H 1"))
3031
{
31-
plan skip_all => 'OAuth server-side tests are not supported on Windows';
32+
plan skip_all =>
33+
'OAuth server-side tests are not supported on this platform';
3234
}
3335

3436
if ($ENV{with_libcurl} ne 'yes')

0 commit comments

Comments
 (0)