Skip to content

Commit 7376e60

Browse files
committed
oauth: Fix kqueue detection on OpenBSD
In b0635bf, I added an early header check to the Meson OAuth support, which was intended to duplicate the later checks for HAVE_SYS_[EVENT|EPOLL]_H. However, I implemented the new test via check_header() -- which tries to compile -- rather than has_header(), which just looks for the file's existence. The distinction matters on OpenBSD, where <sys/event.h> can't be compiled without including prerequisite headers, so -Dlibcurl=enabled failed on that platform. Switch to has_header() to fix this. Note that reviewers expressed concern about the difference between our Autoconf feature tests (which compile headers) and our Meson feature tests (which do not). I'm not opposed to aligning the two, but I want to avoid making bigger changes as part of this fix. Reviewed-by: Peter Eisentraut <peter@eisentraut.org> Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us> Discussion: https://postgr.es/m/flat/CAOYmi+kdR218ke2zu74oTJvzYJcqV1MN5=mGAPqZQuc79HMSVA@mail.gmail.com Backpatch-through: 18
1 parent 3adcf9f commit 7376e60

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

meson.build

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -948,10 +948,10 @@ if not libcurlopt.disabled()
948948
# libcurl and one of either epoll or kqueue.
949949
oauth_flow_supported = (
950950
libcurl.found()
951-
and (cc.check_header('sys/event.h', required: false,
952-
args: test_c_args, include_directories: postgres_inc)
953-
or cc.check_header('sys/epoll.h', required: false,
954-
args: test_c_args, include_directories: postgres_inc))
951+
and (cc.has_header('sys/event.h',
952+
args: test_c_args, include_directories: postgres_inc)
953+
or cc.has_header('sys/epoll.h',
954+
args: test_c_args, include_directories: postgres_inc))
955955
)
956956

957957
if oauth_flow_supported

0 commit comments

Comments
 (0)