diff options
| author | Roy Marples <roy@marples.name> | 2020-11-11 17:44:55 +0000 |
|---|---|---|
| committer | Roy Marples <roy@marples.name> | 2020-11-11 17:44:55 +0000 |
| commit | 77260559dd3896fca1fc415ba57a01a71aedbc57 (patch) | |
| tree | d8baa56f5a44d1d5d32d59d57353db86e20a1691 /src/privsep.c | |
| parent | 040561d61e157e7fb371f1311f0cee3536dee0d2 (diff) | |
| download | dhcpcd-77260559dd3896fca1fc415ba57a01a71aedbc57.tar.xz | |
dhcpcd: Don't create launcher process if keeping in foreground
There is little point.
Diffstat (limited to 'src/privsep.c')
| -rw-r--r-- | src/privsep.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/privsep.c b/src/privsep.c index f43e7ef2..55bb3c42 100644 --- a/src/privsep.c +++ b/src/privsep.c @@ -163,12 +163,13 @@ ps_dropprivs(struct dhcpcd_ctx *ctx) #endif } +#define DHC_NOCHKIO (DHCPCD_STARTED | DHCPCD_DAEMONISE) /* Prohibit writing to files. * Obviously this won't work if we are using a logfile * or redirecting stderr to a file. */ - if (ctx->logfile == NULL && - (ctx->options & DHCPCD_STARTED || - !ctx->stderr_valid || isatty(STDERR_FILENO) == 1)) + if ((ctx->options & DHC_NOCHKIO) == DHC_NOCHKIO || + (ctx->logfile == NULL && + (!ctx->stderr_valid || isatty(STDERR_FILENO) == 1))) { if (setrlimit(RLIMIT_FSIZE, &rzero) == -1) logerr("setrlimit RLIMIT_FSIZE"); |
