mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-02 01:45:17 +00:00
Change virExec() such that with --enable-debug,
stdout and stderr no longer go to /dev/null.
This commit is contained in:
parent
77a2fc0061
commit
cf0ee0f6e4
@ -1,3 +1,8 @@
|
|||||||
|
Thu Jan 10 13:46:14 GMT 2008 Mark McLoughlin <markmc@redhat.com>
|
||||||
|
|
||||||
|
* src/util.c: change virExec() such that with --enable-debug,
|
||||||
|
stdout and stderr no longer go to /dev/null.
|
||||||
|
|
||||||
Thu Jan 10 13:44:17 GMT 2008 Mark McLoughlin <markmc@redhat.com>
|
Thu Jan 10 13:44:17 GMT 2008 Mark McLoughlin <markmc@redhat.com>
|
||||||
|
|
||||||
* src/util.[ch]: Add virRun() helper function (Dan Berrange)
|
* src/util.[ch]: Add virRun() helper function (Dan Berrange)
|
||||||
|
@ -157,10 +157,17 @@ _virExec(virConnectPtr conn,
|
|||||||
|
|
||||||
if (dup2(infd >= 0 ? infd : null, STDIN_FILENO) < 0)
|
if (dup2(infd >= 0 ? infd : null, STDIN_FILENO) < 0)
|
||||||
_exit(1);
|
_exit(1);
|
||||||
|
#ifndef ENABLE_DEBUG
|
||||||
if (dup2(pipeout[1] > 0 ? pipeout[1] : null, STDOUT_FILENO) < 0)
|
if (dup2(pipeout[1] > 0 ? pipeout[1] : null, STDOUT_FILENO) < 0)
|
||||||
_exit(1);
|
_exit(1);
|
||||||
if (dup2(pipeerr[1] > 0 ? pipeerr[1] : null, STDERR_FILENO) < 0)
|
if (dup2(pipeerr[1] > 0 ? pipeerr[1] : null, STDERR_FILENO) < 0)
|
||||||
_exit(1);
|
_exit(1);
|
||||||
|
#else /* ENABLE_DEBUG */
|
||||||
|
if (pipeout[1] > 0 && dup2(pipeout[1], STDOUT_FILENO) < 0)
|
||||||
|
_exit(1);
|
||||||
|
if (pipeerr[1] > 0 && dup2(pipeerr[1], STDERR_FILENO) < 0)
|
||||||
|
_exit(1);
|
||||||
|
#endif /* ENABLE_DEBUG */
|
||||||
|
|
||||||
close(null);
|
close(null);
|
||||||
if (pipeout[1] > 0)
|
if (pipeout[1] > 0)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user