From: W.C.A. Wijngaards Date: Mon, 6 Nov 2023 15:04:46 +0000 (+0100) Subject: - fast-reload, detect loop in sock_poll_timeout routine. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3e17db1f870e9a9b5851aafdc4b525d9f34cb99d;p=thirdparty%2Funbound.git - fast-reload, detect loop in sock_poll_timeout routine. --- diff --git a/daemon/remote.c b/daemon/remote.c index 22128d2a5..5f9d9064f 100644 --- a/daemon/remote.c +++ b/daemon/remote.c @@ -3394,10 +3394,17 @@ int remote_control_callback(struct comm_point* c, void* arg, int err, static int sock_poll_timeout(int fd, int timeout, int pollin, int pollout, int* event) { + int loopcount = 0; /* Loop if the system call returns an errno to do so, like EINTR. */ while(1) { struct pollfd p, *fds; int nfds, ret; + if(++loopcount > 200) { + log_err("sock_poll_timeout: loop"); + if(event) + *event = 0; + return 0; + } if(fd == -1) { fds = NULL; nfds = 0;