[patch 2/2] Enable stdout/stderr spew with --enable-debug

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Change virExec() such that with --enable-debug, stdout
and stderr no longer go to /dev/null.

Signed-off-by: Mark McLoughlin <markmc@xxxxxxxxxx>

Index: libvirt/src/util.c
===================================================================
--- libvirt.orig/src/util.c	2008-01-07 18:00:03.000000000 +0000
+++ libvirt.orig/src/util.c	2008-01-07 18:00:03.000000000 +0000
@@ -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)

-- 

--
Libvir-list mailing list
Libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]