mirror of
https://github.com/rsmarples/dhcpcd.git
synced 2024-11-27 12:03:45 +08:00
privsep: Don't add 1 to max fd open when limiting resources
It shoud no longer be needed for OpenBSD, Linux and Solaris.
This commit is contained in:
parent
44bbb1a68b
commit
62cb1ffc50
@ -148,13 +148,12 @@ ps_dropprivs(struct dhcpcd_ctx *ctx)
|
||||
*/
|
||||
unsigned long maxfd;
|
||||
maxfd = (unsigned long)eloop_event_count(ctx->eloop);
|
||||
if (IN_PRIVSEP_SE(ctx))
|
||||
maxfd++; /* XXX why? */
|
||||
|
||||
struct rlimit rmaxfd = {
|
||||
.rlim_cur = maxfd,
|
||||
.rlim_max = maxfd
|
||||
};
|
||||
|
||||
if (setrlimit(RLIMIT_NOFILE, &rmaxfd) == -1)
|
||||
logerr("setrlimit RLIMIT_NOFILE");
|
||||
#else
|
||||
|
Loading…
Reference in New Issue
Block a user