From d71c1d47ce96e3c593bd1ccd9e5b3f9cc3b7cdc7 Mon Sep 17 00:00:00 2001 From: Glenn Strauss Date: Wed, 14 Oct 2020 17:15:21 -0400 Subject: [PATCH] [core] modify use of getrlimit() to not be fatal modify use of getrlimit() to not be fatal if an error occurs Some container configurations might cause getrlimit() and setrlimit() to fail. lighttpd will issue error trace if this occurs, but will now proceed. x-ref: "aarch64: Use architecture specific header to general syscalls" https://github.com/seccomp/libseccomp/pull/235 "Rasperry Docker PiHole / "Starting lighttpd" Hanging" https://github.com/pi-hole/docker-pi-hole/issues/593 "Pi-hole runs on podman" https://discourse.pi-hole.net/t/pi-hole-runs-on-podman/34719/5 --- src/server.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/server.c b/src/server.c index c019044c..139853d7 100644 --- a/src/server.c +++ b/src/server.c @@ -1237,7 +1237,7 @@ static int server_main_setup (server * const srv, int argc, char **argv) { { #ifdef HAVE_GETRLIMIT - struct rlimit rlim; + struct rlimit rlim = { 4096, 4096 }; int use_rlimit = 1; #ifdef HAVE_VALGRIND_VALGRIND_H if (RUNNING_ON_VALGRIND) use_rlimit = 0; @@ -1245,7 +1245,7 @@ static int server_main_setup (server * const srv, int argc, char **argv) { if (0 != getrlimit(RLIMIT_NOFILE, &rlim)) { log_perror(srv->errh, __FILE__, __LINE__, "getrlimit()"); - return -1; + use_rlimit = 0; } /**