mirror of
https://github.com/postgres/postgres.git
synced 2025-07-02 09:02:37 +03:00
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
This commit is contained in:
@ -1172,8 +1172,9 @@ static int
|
|||||||
register_socket(CURL *curl, curl_socket_t socket, int what, void *ctx,
|
register_socket(CURL *curl, curl_socket_t socket, int what, void *ctx,
|
||||||
void *socketp)
|
void *socketp)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_SYS_EPOLL_H
|
|
||||||
struct async_ctx *actx = ctx;
|
struct async_ctx *actx = ctx;
|
||||||
|
|
||||||
|
#ifdef HAVE_SYS_EPOLL_H
|
||||||
struct epoll_event ev = {0};
|
struct epoll_event ev = {0};
|
||||||
int res;
|
int res;
|
||||||
int op = EPOLL_CTL_ADD;
|
int op = EPOLL_CTL_ADD;
|
||||||
@ -1231,7 +1232,6 @@ register_socket(CURL *curl, curl_socket_t socket, int what, void *ctx,
|
|||||||
return 0;
|
return 0;
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_SYS_EVENT_H
|
#ifdef HAVE_SYS_EVENT_H
|
||||||
struct async_ctx *actx = ctx;
|
|
||||||
struct kevent ev[2] = {0};
|
struct kevent ev[2] = {0};
|
||||||
struct kevent ev_out[2];
|
struct kevent ev_out[2];
|
||||||
struct timespec timeout = {0};
|
struct timespec timeout = {0};
|
||||||
|
@ -26,9 +26,11 @@ if (!$ENV{PG_TEST_EXTRA} || $ENV{PG_TEST_EXTRA} !~ /\boauth\b/)
|
|||||||
'Potentially unsafe test oauth not enabled in PG_TEST_EXTRA';
|
'Potentially unsafe test oauth not enabled in PG_TEST_EXTRA';
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($windows_os)
|
unless (check_pg_config("#define HAVE_SYS_EVENT_H 1")
|
||||||
|
or check_pg_config("#define HAVE_SYS_EPOLL_H 1"))
|
||||||
{
|
{
|
||||||
plan skip_all => 'OAuth server-side tests are not supported on Windows';
|
plan skip_all =>
|
||||||
|
'OAuth server-side tests are not supported on this platform';
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($ENV{with_libcurl} ne 'yes')
|
if ($ENV{with_libcurl} ne 'yes')
|
||||||
|
Reference in New Issue
Block a user