]> xenbits.xensource.com Git - libvirt.git/commitdiff
Change virExec() such that with --enable-debug,
authorMark McLoughlin <markmc@redhat.com>
Thu, 10 Jan 2008 13:47:49 +0000 (13:47 +0000)
committerMark McLoughlin <markmc@redhat.com>
Thu, 10 Jan 2008 13:47:49 +0000 (13:47 +0000)
stdout and stderr no longer go to /dev/null.

ChangeLog
src/util.c

index c9b275aa37d5f2157c0f9a8576d15621174ac6eb..816d775a5c124a023d6393656bc23e8300d6aa90 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -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>
 
        * src/util.[ch]: Add virRun() helper function (Dan Berrange)
index 755c4c2c79cf00d18a5d184e82368316a64aca7a..d23237ef2c666d428e44a35795bf4df714e89f3c 100644 (file)
@@ -157,10 +157,17 @@ _virExec(virConnectPtr conn,
 
     if (dup2(infd >= 0 ? infd : null, STDIN_FILENO) < 0)
         _exit(1);
+#ifndef ENABLE_DEBUG
     if (dup2(pipeout[1] > 0 ? pipeout[1] : null, STDOUT_FILENO) < 0)
         _exit(1);
     if (dup2(pipeerr[1] > 0 ? pipeerr[1] : null, STDERR_FILENO) < 0)
         _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);
     if (pipeout[1] > 0)