aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--daemon.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/daemon.c b/daemon.c
index 1cef3098d..8c317bed4 100644
--- a/daemon.c
+++ b/daemon.c
@@ -1118,7 +1118,9 @@ int main(int argc, char **argv)
struct sockaddr *peer = (struct sockaddr *)&ss;
socklen_t slen = sizeof(ss);
- freopen("/dev/null", "w", stderr);
+ if (!freopen("/dev/null", "w", stderr))
+ die("failed to redirect stderr to /dev/null: %s",
+ strerror(errno));
if (getpeername(0, peer, &slen))
peer = NULL;