diff --git a/src/util/vircommand.c b/src/util/vircommand.c index 77078d09fb..b84fb40948 100644 --- a/src/util/vircommand.c +++ b/src/util/vircommand.c @@ -797,8 +797,7 @@ virExec(virCommandPtr cmd) virProcessSetMaxCoreSize(0, cmd->maxCore) < 0) goto fork_error; if (cmd->pidfile) { - VIR_AUTOCLOSE pidfilefd = -1; - int newpidfilefd = -1; + int pidfilefd = -1; char c; pidfilefd = virPidFileAcquirePath(cmd->pidfile, false, getpid()); @@ -818,14 +817,7 @@ virExec(virCommandPtr cmd) VIR_FORCE_CLOSE(pipesync[0]); VIR_FORCE_CLOSE(pipesync[1]); - /* This is here only to move the pidfilefd - * to the lowest possible number. */ - if ((newpidfilefd = dup(pidfilefd)) < 0) { - virReportSystemError(errno, "%s", _("Unable to dup FD")); - goto fork_error; - } - - /* newpidfilefd is intentionally leaked. */ + /* pidfilefd is intentionally leaked. */ } if (cmd->hook) { diff --git a/tests/commanddata/test4.log b/tests/commanddata/test4.log index 5820f28307..24a37a7e96 100644 --- a/tests/commanddata/test4.log +++ b/tests/commanddata/test4.log @@ -9,7 +9,7 @@ ENV:USER=test FD:0 FD:1 FD:2 -FD:3 +FD:5 DAEMON:yes CWD:/ UMASK:0022