Skip to content

Commit

Permalink
net_gethosterror: Handle EAI_SYSTEM ("System error") properly
Browse files Browse the repository at this point in the history
That error code means "check errno". A few users got it and we never
figured out what happened - it usually fixed itself after restarting
something - so hopefully with this we'll have more information the next
time.
  • Loading branch information
dequis committed Apr 7, 2016
1 parent 1349755 commit 2ba4b9d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/core/network.c
Expand Up @@ -510,7 +510,11 @@ const char *net_gethosterror(int error)
{
g_return_val_if_fail(error != 0, NULL);

return gai_strerror(error);
if (error == EAI_SYSTEM) {
return strerror(errno);
} else {
return gai_strerror(error);
}
}

/* return TRUE if host lookup failed because it didn't exist (ie. not
Expand Down

0 comments on commit 2ba4b9d

Please sign in to comment.