summaryrefslogtreecommitdiffstats
path: root/src/privsep.c
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2020-06-29 13:14:21 +0100
committerRoy Marples <roy@marples.name>2020-06-29 13:14:21 +0100
commit9593df81abd6b0508eafad0d45aa6c0e112922ba (patch)
tree013eb0ec6dca37417f3cad1d2420f153e2fceb96 /src/privsep.c
parentb3cbcc5a8b6b7d9d5db71006c74038da3a85333d (diff)
downloaddhcpcd-9593df81abd6b0508eafad0d45aa6c0e112922ba.tar.xz
privsep: check return of freopen(3)
So shutup some compilers who complain we don't do anything with it.
Diffstat (limited to 'src/privsep.c')
-rw-r--r--src/privsep.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/privsep.c b/src/privsep.c
index 5bbc4863..34e00a40 100644
--- a/src/privsep.c
+++ b/src/privsep.c
@@ -368,8 +368,9 @@ ps_dostart(struct dhcpcd_ctx *ctx,
if (!(ctx->options & DHCPCD_DEBUG) &&
(!(ctx->options & DHCPCD_TEST) || loggetopts() & LOGERR_QUIET))
{
- (void)freopen(_PATH_DEVNULL, "w", stdout);
- (void)freopen(_PATH_DEVNULL, "w", stderr);
+ if (freopen(_PATH_DEVNULL, "w", stdout) == NULL ||
+ freopen(_PATH_DEVNULL, "w", stderr) == NULL)
+ logerr("%s: freopen", __func__);
}
if (flags & PSF_DROPPRIVS)