mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2026-01-30 06:22:00 +01:00
MINOR: checks: use my_closefrom() to close all FDs
Instead of looping on all FDs, let's use my_closefrom() which does it respecting the current process' limits and possibly doing it more efficiently.
This commit is contained in:
parent
2d7f81b809
commit
2555ccf4d0
@ -1970,8 +1970,7 @@ static int connect_proc_chk(struct task *t)
|
||||
/* close all FDs. Keep stdin/stdout/stderr in verbose mode */
|
||||
fd = (global.mode & (MODE_QUIET|MODE_VERBOSE)) == MODE_QUIET ? 0 : 3;
|
||||
|
||||
while (fd < global.rlimit_nofile)
|
||||
close(fd++);
|
||||
my_closefrom(fd);
|
||||
|
||||
environ = check->envp;
|
||||
extchk_setenv(check, EXTCHK_HAPROXY_SERVER_CURCONN, ultoa_r(s->cur_sess, buf, sizeof(buf)));
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user