Fix file descriptor leak in SetDaemonIO

This commit is contained in:
Gunnar Beutner 2015-03-03 07:36:43 +01:00
parent 7c31654552
commit ac7a55cf56
1 changed files with 1 additions and 1 deletions

View File

@ -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);