From b7871c7368d19d344865e97de3e62f52f3092be4 Mon Sep 17 00:00:00 2001 From: Pauli Date: Mon, 11 Jun 2018 22:36:27 +0300 Subject: [PATCH] Console-posix: Use lowest possible nfds parameter to the select call --- library/Console-posix.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/Console-posix.cpp b/library/Console-posix.cpp index ef74e67d2..9c244de10 100644 --- a/library/Console-posix.cpp +++ b/library/Console-posix.cpp @@ -157,7 +157,7 @@ namespace DFHack FD_SET(STDIN_FILENO, &descriptor_set); FD_SET(exit_pipe[0], &descriptor_set); int ret = TMP_FAILURE_RETRY( - select (FD_SETSIZE,&descriptor_set, NULL, NULL, NULL) + select (std::max(STDIN_FILENO,exit_pipe[0])+1,&descriptor_set, NULL, NULL, NULL) ); if(ret == -1) return false;