Skip to content

Commit

Permalink
main: use new fd_setsize -1 instead of getrlimit
Browse files Browse the repository at this point in the history
  • Loading branch information
sreimers committed May 17, 2022
1 parent 4d5f36e commit 03ff6d4
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
#ifdef HAVE_GETOPT
#include <getopt.h>
#endif
#include <sys/resource.h>
#include <pthread.h>
#include <re.h>
#include <restund.h>
Expand Down Expand Up @@ -203,14 +202,7 @@ int main(int argc, char *argv[])

restund_cmd_subscribe(&cmd_reload);

struct rlimit limits;
err = getrlimit(RLIMIT_NOFILE, &limits);
if (err) {
restund_warning("error determining nofile rlimit: %m\n", err);
goto out;
}

err = fd_setsize((int)limits.rlim_max - 42);
err = fd_setsize(-1);
if (err) {
restund_warning("fd_setsize error: %m\n", err);
goto out;
Expand Down

0 comments on commit 03ff6d4

Please sign in to comment.