This fixes for 'nft monitor' aborting with: *** bit out of range 0 - FD_SETSIZE on fd_set ***: terminated It appears FD_ISSET is not tolerating invalid fd values (-1 in this case). Fixes: 868040f892238 ("configure: Implement --enable-profiling option") Signed-off-by: Phil Sutter --- src/mnl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mnl.c b/src/mnl.c index 3f3ef82a25cb5..2e7ae74434094 100644 --- a/src/mnl.c +++ b/src/mnl.c @@ -2410,7 +2410,7 @@ int mnl_nft_event_listener(struct mnl_socket *nf_sock, unsigned int debug_mask, if (ret < 0) return -1; - if (FD_ISSET(sigfd, &readfds)) + if (sigfd != -1 && FD_ISSET(sigfd, &readfds)) check_signalfd(sigfd); if (FD_ISSET(fd, &readfds)) { -- 2.51.0