From ac7a55cf56f1ce5ebe3671a37c0a44c7a5ada5c3 Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Tue, 3 Mar 2015 07:36:43 +0100 Subject: [PATCH] Fix file descriptor leak in SetDaemonIO --- lib/cli/daemoncommand.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/cli/daemoncommand.cpp b/lib/cli/daemoncommand.cpp index 503c83a89..f82071b5c 100644 --- a/lib/cli/daemoncommand.cpp +++ b/lib/cli/daemoncommand.cpp @@ -134,7 +134,7 @@ static bool SetDaemonIO(const String& stderrFile) if (fderr < 0 && errno == ENOENT) fderr = open(errPath, O_CREAT | O_WRONLY | O_APPEND, 0600); - if (fderr > 0) { + if (fderr >= 0) { if (fderr != 2) dup2(fderr, 2); -- 2.40.0