Permalink
Browse files

Ignoring NONAME error from getaddrinfo so we have hostname set even

without working network
  • Loading branch information...
jvymazal committed May 31, 2017
1 parent 1662abd commit 1a7d3a088969b47798bc1da712ca2772f91a7c02
Showing with 5 additions and 1 deletion.
  1. +5 −1 runtime/net.c
@@ -1188,7 +1188,11 @@ getLocalHostname(uchar **ppName)
memset(&flags, 0, sizeof(flags));
flags.ai_flags = AI_CANONNAME;
int error = getaddrinfo((char*)hnbuf, NULL, &flags, &res);
if (error != 0) {
if (error != 0 &&
error != EAI_NONAME && error != EAI_AGAIN && error != EAI_FAIL) {
/* If we get one of errors above, network is probably
* not working yet, so we fall back to local hostname below
*/
dbgprintf("getaddrinfo: %s\n", gai_strerror(error));
ABORT_FINALIZE(RS_RET_IO_ERROR);
}

0 comments on commit 1a7d3a0

Please sign in to comment.