From fa1715b5155c88749af8ecedfeffc97a4502fd9c Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Mon, 19 Feb 2001 02:13:02 +0000 Subject: If reading host answer from pipe failed, set the error message to "Host name lookup: g_strerror(errno)" git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1244 dbcabf3a-b0e7-0310-adc4-f8d773084564 --- src/core/net-nonblock.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/core/net-nonblock.c') 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 -- cgit v1.2.3