]> xenbits.xensource.com Git - libvirt.git/commitdiff
virExec: fix bug in setting up child stderr/out with /dev/null
authorDaniel P. Berrange <berrange@redhat.com>
Tue, 25 May 2010 11:14:25 +0000 (12:14 +0100)
committerEric Blake <eblake@redhat.com>
Thu, 18 Nov 2010 19:21:58 +0000 (12:21 -0700)
src/util/util.c

index 2d6485f07960a676ce29310dbd3b89f8b753861f..f2fe58a8488f908cd861b01260d87839f455b1d7 100644 (file)
@@ -463,7 +463,7 @@ __virExec(const char *const*argv,
     int childerr = -1;
     int tmpfd;
 
-    if ((null = open("/dev/null", O_RDONLY)) < 0) {
+    if ((null = open("/dev/null", O_RDWR)) < 0) {
         virReportSystemError(errno,
                              _("cannot open %s"),
                              "/dev/null");