[master] e87afd691 nit: Use RLIMIT_MEMLOCK only where available

Nils Goroll nils.goroll at uplex.de
Mon Sep 23 16:41:06 UTC 2024


commit e87afd691d820d9fcb28f3621c4a23a3c0bbb780
Author: Nils Goroll <nils.goroll at uplex.de>
Date:   Mon Sep 23 18:40:22 2024 +0200

    nit: Use RLIMIT_MEMLOCK only where available
    
    Not my day for details today, it seems. :(

diff --git a/bin/varnishd/mgt/mgt_main.c b/bin/varnishd/mgt/mgt_main.c
index d48a3fd06..4db07013c 100644
--- a/bin/varnishd/mgt/mgt_main.c
+++ b/bin/varnishd/mgt/mgt_main.c
@@ -637,7 +637,6 @@ main(int argc, char * const *argv)
 	pid_t pid;
 	struct arg_list *alp;
 	int first_arg = 1;
-	struct rlimit rlim;
 
 	if (argc == 2 && !strcmp(argv[1], "--optstring")) {
 		printf("%s\n", opt_spec);
@@ -877,6 +876,7 @@ main(int argc, char * const *argv)
 	VJ_master(JAIL_MASTER_SYSTEM);
 #ifdef RLIMIT_MEMLOCK
 	/* try to raise to max (ignore error), then set _cur to whatever we got */
+	struct rlimit rlim;
 	rlim.rlim_cur = 0;
 	rlim.rlim_max = RLIM_INFINITY;
 	(void)setrlimit(RLIMIT_MEMLOCK, &rlim);


More information about the varnish-commit mailing list