From: Jan Klötzke <[email protected]>

If gethostent_r fails, the h_errnop error code should be set.

Signed-off-by: Marcus Haehnel <[email protected]>
---
 libc/inet/resolv.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libc/inet/resolv.c b/libc/inet/resolv.c
index d7a659a8c..130a9a505 100644
--- a/libc/inet/resolv.c
+++ b/libc/inet/resolv.c
@@ -2699,7 +2699,7 @@ int gethostent_r(struct hostent *result_buf, char *buf, 
size_t buflen,
                hostp = __open_etc_hosts();
                if (hostp == NULL) {
                        *result = NULL;
-                       ret = TRY_AGAIN;
+                       *h_errnop = ret = TRY_AGAIN;
                        goto DONE;
                }
        }
-- 
2.47.1

_______________________________________________
devel mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to