Skip to content

Commit

Permalink
[core] modify use of getrlimit() to not be fatal
Browse files Browse the repository at this point in the history
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"
  seccomp/libseccomp#235
  "Rasperry Docker PiHole / "Starting lighttpd" Hanging"
  pi-hole/docker-pi-hole#593
  "Pi-hole runs on podman"
  https://discourse.pi-hole.net/t/pi-hole-runs-on-podman/34719/5
  • Loading branch information
gstrauss committed Oct 20, 2020
1 parent 3f1a12e commit d71c1d4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/server.c
Expand Up @@ -1237,15 +1237,15 @@ 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;
#endif

if (0 != getrlimit(RLIMIT_NOFILE, &rlim)) {
log_perror(srv->errh, __FILE__, __LINE__, "getrlimit()");
return -1;
use_rlimit = 0;
}

/**
Expand Down

0 comments on commit d71c1d4

Please sign in to comment.