diff options
Diffstat (limited to 'sircbot.c')
-rw-r--r-- | sircbot.c | 17 |
1 files changed, 14 insertions, 3 deletions
@@ -348,9 +348,20 @@ 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) && i == 0) - /* server hang up on us */ - return 0; + if (fds[i].revents & POLLHUP) { + if (i == 0) + /* server hang up on us */ + return 0; + + /* one of the fifos closed due to + writer process exit. We just + reopen it assuming we are still + joined the channel */ + close_fifo(&chan[i-1], + chan[i-1].last_closetime); + init_fifo(&chan[i-1]); + continue; + } if (fds[i].revents & POLLERR) goto ret_err; |