diff options
author | Claudio Jeker <claudio@cvs.openbsd.org> | 2022-01-20 18:06:21 +0000 |
---|---|---|
committer | Claudio Jeker <claudio@cvs.openbsd.org> | 2022-01-20 18:06:21 +0000 |
commit | a8f01c806f4beae94c7bfee6f832235c22324f61 (patch) | |
tree | 10dada3d24dfe6f2a0d17416386b51923f7f4298 /usr.sbin/bgpd/bgpd.c | |
parent | fa4cade53edbf1e71cee5b7fcc0039e991aea048 (diff) |
Make sure that all poll loops properly restart the poll loop on EINTR.
Also either fail hard or restart after other errors. In anycase do not
look at pollfds after an error.
OK benno@
Diffstat (limited to 'usr.sbin/bgpd/bgpd.c')
-rw-r--r-- | usr.sbin/bgpd/bgpd.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/usr.sbin/bgpd/bgpd.c b/usr.sbin/bgpd/bgpd.c index b684cb49f45..537d491b142 100644 --- a/usr.sbin/bgpd/bgpd.c +++ b/usr.sbin/bgpd/bgpd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bgpd.c,v 1.239 2021/07/20 12:07:46 claudio Exp $ */ +/* $OpenBSD: bgpd.c,v 1.240 2022/01/20 18:06:20 claudio Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -345,11 +345,13 @@ BROKEN if (pledge("stdio rpath wpath cpath fattr unix route recvfd sendfd", if (timeout < 0 || timeout > MAX_TIMEOUT) timeout = MAX_TIMEOUT; - if (poll(pfd, npfd, timeout * 1000) == -1) + if (poll(pfd, npfd, timeout * 1000) == -1) { if (errno != EINTR) { log_warn("poll error"); quit = 1; } + continue; + } if (handle_pollfd(&pfd[PFD_PIPE_SESSION], ibuf_se) == -1) { log_warnx("main: Lost connection to SE"); |