From 2ba4b9d26afb87c2e661b1c07313ca78b3c5618e Mon Sep 17 00:00:00 2001 From: dequis Date: Mon, 4 Apr 2016 03:47:48 -0300 Subject: [PATCH] net_gethosterror: Handle EAI_SYSTEM ("System error") properly 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. --- src/core/network.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/core/network.c b/src/core/network.c index 76659f3e..3e1b7c70 100644 --- a/src/core/network.c +++ b/src/core/network.c @@ -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