summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/core/net-nonblock.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/core/net-nonblock.c b/src/core/net-nonblock.c
index 4b9ab283..c6d512f6 100644
--- a/src/core/net-nonblock.c
+++ b/src/core/net-nonblock.c
@@ -127,13 +127,16 @@ int net_gethostbyname_return(GIOChannel *pipe, RESOLVED_IP_REC *rec)
rec->error = -1;
rec->errorstr = NULL;
- /* get ip+error - try for max. 1-2 seconds */
#ifndef WIN32
fcntl(g_io_channel_unix_get_fd(pipe), F_SETFL, O_NONBLOCK);
#endif
- if (g_io_channel_read_block(pipe, rec, sizeof(*rec)) == -1)
- return -1;
+ /* get ip+error */
+ if (g_io_channel_read_block(pipe, rec, sizeof(*rec)) == -1) {
+ rec->errorstr = g_strdup_printf("Host name lookup: %s",
+ g_strerror(errno));
+ return -1;
+ }
if (rec->error) {
/* read error string, if we can't read everything for some