Browse Source

inet/resolv.c: set h_errnop if /etc/hosts cannot be opened

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

Signed-off-by: Marcus Haehnel <marcus.haehnel@kernkonzept.com>
Jan Klötzke 2 months ago
parent
commit
f459ac62a9
1 changed files with 1 additions and 1 deletions
  1. 1 1
      libc/inet/resolv.c

+ 1 - 1
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;
 		}
 	}