aboutsummaryrefslogtreecommitdiffstats
path: root/sircbot.c
diff options
context:
space:
mode:
Diffstat (limited to 'sircbot.c')
-rw-r--r--sircbot.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/sircbot.c b/sircbot.c
index 4c85772..0999ac5 100644
--- a/sircbot.c
+++ b/sircbot.c
@@ -272,12 +272,12 @@ static void irc_reset_pollfds(struct irc_session *sess, struct pollfd *fds,
int i;
/* first pollfd struc is the irc session */
fds[0].fd = sess->fd;
- fds[0].events = POLLIN | POLLHUP | POLLERR;
+ fds[0].events = POLLIN;
fds[0].revents = 0;
/* rest is channel fifos */
for (i = 1; i < numchan + 1; i++) {
fds[i].fd = chan[i-1].fd;
- fds[i].events = POLLIN | POLLHUP | POLLERR;
+ fds[i].events = POLLIN;
fds[i].revents = 0;
}
}
@@ -347,7 +347,8 @@ static int irc_loop(struct irc_session *sess, struct sircbot_channel *chan,
send_fifo_queue(sess, &chan[i-1], now) < 0)
goto ret_err;
- if (fds[i].revents & POLLHUP)
+ if ((fds[i].revents & POLLHUP) && i == 0)
+ /* server hang up on us */
return 0;
if (fds[i].revents & POLLERR)