From c923a184c695043b934e6ddc26f3a1ad34cb216f Mon Sep 17 00:00:00 2001 From: Kirill Rodriguez Date: Tue, 15 Oct 2024 21:02:53 +0100 Subject: [PATCH] getaddrinfo with localhost does not necessarily read files --- test/regress_dns.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/regress_dns.c b/test/regress_dns.c index 31fcfbcc..251a3dd0 100644 --- a/test/regress_dns.c +++ b/test/regress_dns.c @@ -1679,6 +1679,10 @@ test_bufferevent_connect_hostname(void *arg) tt_int_op(be_outcome[2].what, ==, !emfile ? BEV_EVENT_CONNECTED : BEV_EVENT_ERROR); tt_int_op(be_outcome[2].dnserr, ==, 0); tt_int_op(be_outcome[3].what, ==, !emfile ? BEV_EVENT_CONNECTED : BEV_EVENT_ERROR); + /* + * Some platforms check for localhost explicitly, and therefore may succeed without opening any files * + * e.g. https://github.com/openbsd/src/blob/53e0023678f73561cc0c0c07e49830be23d94673/lib/libc/asr/getaddrinfo_async.c#L234 + */ if (!emfile) { tt_int_op(be_outcome[3].dnserr, ==, 0); } else {