Commit d94c7f8d authored by Nils Goroll's avatar Nils Goroll Committed by Dridi Boukelmoune

fix insignificant off-by-one in child file descriptor close code

The name CLOSE_FD_UP_TO implies that the value is included.

Also this is the semantics of MCH_TrackHighFd() and relevant for
 #define CLOSE_FD_UP_TO mgt_max_fd
parent 03a2102b
......@@ -344,7 +344,7 @@ mgt_launch_child(struct cli *cli)
*/
closelog();
for (i = STDERR_FILENO + 1; i < CLOSE_FD_UP_TO; i++) {
for (i = STDERR_FILENO + 1; i <= CLOSE_FD_UP_TO; i++) {
if (vbit_test(fd_map, i))
continue;
if (close(i) == 0)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment