From bdbdf79787fb744c5accfa8921e15335971e9efb Mon Sep 17 00:00:00 2001 From: tomsmeding Date: Sun, 9 Apr 2017 20:35:34 +0200 Subject: weechat: Better recv() <= 0 error reporting --- weechat/tomsg.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/weechat/tomsg.c b/weechat/tomsg.c index 9c92543..e800c16 100644 --- a/weechat/tomsg.c +++ b/weechat/tomsg.c @@ -289,8 +289,10 @@ static int fd_hook_callback(const void *conn_vp,void *_d,int fd){ if(nr<0){ if(errno==EINTR)continue; if(errno==EAGAIN)return WEECHAT_RC_OK; // next time around maybe? + fprintf(debugf,"fd_hook_callback: recv() < 0: %s\n",strerror(errno)); + } else { + fprintf(debugf,"fd_hook_callback: recv() == 0 (EOF)\n"); } - fprintf(debugf,"fd_hook_callback: recv() <= 0: %s\n",strerror(errno)); weechat_printf(NULL,"tomsg: Connection dropped"); weechat_buffer_close(conn->buffer); return WEECHAT_RC_OK; -- cgit v1.2.3-70-g09d2