summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTimo Sirainen <cras@irssi.org>2001-02-19 02:13:02 +0000
committercras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564>2001-02-19 02:13:02 +0000
commitfa1715b5155c88749af8ecedfeffc97a4502fd9c (patch)
tree158b4b382f1218a7e7ab5fe224ae34278c0e4c25 /src
parent2790a3b0b5ba14985b67e334c7069dcb28e687b6 (diff)
downloadirssi-fa1715b5155c88749af8ecedfeffc97a4502fd9c.zip
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
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