]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
REORG: global: move rlim_fd_*_at_boot in limits
authorValentine Krasnobaeva <vkrasnobaeva@haproxy.com>
Wed, 10 Jul 2024 10:41:26 +0000 (12:41 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 10 Jul 2024 16:05:48 +0000 (18:05 +0200)
Let's move in 'limits' compilation unit global variables to keep the initial
process fd limits.

include/haproxy/global.h
include/haproxy/limits.h
src/haproxy.c
src/limits.c

index 55534687864004a8fbf901a1ca415b9249996250..561802a83733da3978f5b0b54233461127f73b8d 100644 (file)
@@ -45,8 +45,6 @@ extern char *localpeer;
 extern unsigned int warned;     /* bitfield of a few warnings to emit just once */
 extern struct list proc_list; /* list of process in mworker mode */
 extern int master; /* 1 if in master, 0 otherwise */
-extern unsigned int rlim_fd_cur_at_boot;
-extern unsigned int rlim_fd_max_at_boot;
 extern int atexit_flag;
 extern unsigned char boot_seed[20];  // per-boot random seed (160 bits initially)
 extern THREAD_LOCAL struct buffer trash;
index 4db6989b33f9c18cc8039239ae1fa94a54647504..f9ff625f3beed29eae3aa12369a5b0e8d79c4c9a 100644 (file)
@@ -9,6 +9,9 @@
 #define _HAPROXY_LIMITS_H
 #include <sys/resource.h>
 
+extern unsigned int rlim_fd_cur_at_boot;
+extern unsigned int rlim_fd_max_at_boot;
+
 /* handlers to manipulate system resources limits granted by OS to process and
  * to tie them up with the internal process limits
  */
index cf23dba529bbdf68dd1ed140b0386937a1e796d1..4c63c22f6dc166b78a6ca6d852b558871eeb7d1f 100644 (file)
@@ -255,8 +255,6 @@ static char **old_argv = NULL; /* previous argv but cleaned up */
 struct list proc_list = LIST_HEAD_INIT(proc_list);
 
 int master = 0; /* 1 if in master, 0 if in child */
-unsigned int rlim_fd_cur_at_boot = 0;
-unsigned int rlim_fd_max_at_boot = 0;
 
 /* per-boot randomness */
 unsigned char boot_seed[20];        /* per-boot random seed (160 bits initially) */
index 8d0bf7b4639b811511ec96eebb02bb3d63b7eba6..badeeb089559a70e6b17f5aa0a388667dafb4522 100644 (file)
@@ -11,6 +11,9 @@
 #include <haproxy/proxy.h>
 
 
+unsigned int rlim_fd_cur_at_boot = 0;
+unsigned int rlim_fd_max_at_boot = 0;
+
 /* Sets the RLIMIT_NOFILE setting to <new_limit> and returns the previous one
  * in <old_limit> if the pointer is not NULL, even if set_rlimit() fails. The
  * two pointers may point to the same variable as the copy happens after