Break out of select loop if all the fds we want to select on are -1.

This commit is contained in:
Todd C. Miller
2010-05-20 17:13:22 -04:00
parent 20c125297f
commit d18b458e1f

View File

@@ -1122,6 +1122,8 @@ script_child(const char *path, char *argv[], char *envp[], int backchannel, int
if (errpipe[0] != -1)
FD_SET(errpipe[0], fdsr);
maxfd = MAX(errpipe[0], backchannel);
if (maxfd == -1)
goto done;
if (recvsig[SIGCHLD])
continue;