diff options
-rw-r--r-- | receive.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/receive.c b/receive.c index 9b620e1..169ebba 100644 --- a/receive.c +++ b/receive.c @@ -234,13 +234,15 @@ main(void) { handle_irc(fds[1].fd); } if (fds[1].revents & POLLHUP) { - fprintf(stderr, "IRC disconnected; trying to reconnect\n"); close(fds[1].fd); - fds[1].fd = connect_irc(); - /* could exit(3) in connect_irc */ + if (fds[2].fd >= 0) + close(fds[2].fd); + close(fds[0].fd); + errx(1, "IRC disconnected; exiting"); } } close(fds[0].fd); + return 0; } #else int main(void) { |