[6.0] d94c7f8db fix insignificant off-by-one in child file descriptor close code

Dridi Boukelmoune dridi.boukelmoune at gmail.com
Wed Feb 6 10:11:10 UTC 2019


commit d94c7f8db1b6ae5692acc52ddeeebf8b4dd876f9
Author: Nils Goroll <nils.goroll at uplex.de>
Date:   Thu Nov 22 13:21:24 2018 +0100

    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

diff --git a/bin/varnishd/mgt/mgt_child.c b/bin/varnishd/mgt/mgt_child.c
index 16050b33a..c5487d94e 100644
--- a/bin/varnishd/mgt/mgt_child.c
+++ b/bin/varnishd/mgt/mgt_child.c
@@ -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)


More information about the varnish-commit mailing list