diff options
author | Henning Brauer <henning@cvs.openbsd.org> | 2004-01-04 23:08:10 +0000 |
---|---|---|
committer | Henning Brauer <henning@cvs.openbsd.org> | 2004-01-04 23:08:10 +0000 |
commit | a9270df57059829da96f67a1e097a5971f9299b0 (patch) | |
tree | 1b04a7601b41ab8d691591ca176e761612889d59 | |
parent | d1da867b6fb751e1c529eae09f2934dfaabceb6a (diff) |
cope with poll error
-rw-r--r-- | usr.sbin/bgpd/session.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/usr.sbin/bgpd/session.c b/usr.sbin/bgpd/session.c index 7ae34291e1f..99c5a63da65 100644 --- a/usr.sbin/bgpd/session.c +++ b/usr.sbin/bgpd/session.c @@ -1,4 +1,4 @@ -/* $OpenBSD: session.c,v 1.63 2004/01/04 20:21:07 henning Exp $ */ +/* $OpenBSD: session.c,v 1.64 2004/01/04 23:08:09 henning Exp $ */ /* * Copyright (c) 2003 Henning Brauer <henning@openbsd.org> @@ -274,10 +274,10 @@ session_main(struct bgpd_config *config, struct peer *cpeers, int pipe_m2s[2], timeout = nextaction - time(NULL); if (timeout < 0) timeout = 0; - nfds = poll(pfd, i, timeout * 1000); - /* - * what do we do on poll error? - */ + if ((nfds = poll(pfd, i, timeout * 1000)) == -1) + if (errno != EINTR) + fatal("poll error"); + if (nfds > 0 && pfd[PFD_LISTEN].revents & POLLIN) { nfds--; session_accept(sock); |