getaddrinfo with localhost does not necessarily read files

This commit is contained in:
Kirill Rodriguez 2024-10-15 21:02:53 +01:00
parent 096c5fe584
commit c923a184c6
No known key found for this signature in database
GPG Key ID: 2AA85EC2AD7F85EA

View File

@ -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 {