summaryrefslogtreecommitdiffstats
path: root/cmd
diff options
context:
space:
mode:
Diffstat (limited to 'cmd')
-rw-r--r--cmd/zed/zed.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/cmd/zed/zed.c b/cmd/zed/zed.c
index f85668fea..55ab68cd0 100644
--- a/cmd/zed/zed.c
+++ b/cmd/zed/zed.c
@@ -199,7 +199,7 @@ _finish_daemonize(void)
zed_log_die("Failed to dup /dev/null onto stderr: %s",
strerror(errno));
- if (close(devnull) < 0)
+ if ((devnull > STDERR_FILENO) && (close(devnull) < 0))
zed_log_die("Failed to close /dev/null: %s", strerror(errno));
/* Notify parent that daemonization is complete. */