]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commitdiff
virsh: fix mingw startup
authorEric Blake <eblake@redhat.com>
Wed, 6 Apr 2011 14:10:28 +0000 (08:10 -0600)
committerEric Blake <eblake@redhat.com>
Thu, 7 Apr 2011 21:13:24 +0000 (15:13 -0600)
* .gnulib: Update to latest, for pipe2.
* bootstrap.conf (gnulib_modules): Add pipe2.
* src/util/event_poll.c (virEventPollInit): Use it, to avoid
problematic virSetCloseExec on mingw.

.gnulib
bootstrap.conf
src/util/event_poll.c

diff --git a/.gnulib b/.gnulib
index f79652003534e496bca1e49922ca521f12ca8051..bd5d1e621103ea3f7fbae09010348ce2df563808 160000 (submodule)
--- a/.gnulib
+++ b/.gnulib
@@ -1 +1 @@
-Subproject commit f79652003534e496bca1e49922ca521f12ca8051
+Subproject commit bd5d1e621103ea3f7fbae09010348ce2df563808
index 11d2199c995a3000c512978ca78a2f41bc924ce1..3db0c6373a02d5e827550f0ebaf7dc486fc986fe 100644 (file)
@@ -54,6 +54,7 @@ nonblocking
 perror
 physmem
 pipe-posix
+pipe2
 poll
 posix-shell
 pthread
index 91000e29ab67eea6679cbebe0a4dbaebf5e9e668..cd1ff4a0f9ff0ad93f3594cf125377b927712cb7 100644 (file)
@@ -29,6 +29,7 @@
 #include <sys/time.h>
 #include <errno.h>
 #include <unistd.h>
+#include <fcntl.h>
 
 #include "threads.h"
 #include "logging.h"
@@ -657,11 +658,7 @@ int virEventPollInit(void)
         return -1;
     }
 
-    if (pipe(eventLoop.wakeupfd) < 0 ||
-        virSetNonBlock(eventLoop.wakeupfd[0]) < 0 ||
-        virSetNonBlock(eventLoop.wakeupfd[1]) < 0 ||
-        virSetCloseExec(eventLoop.wakeupfd[0]) < 0 ||
-        virSetCloseExec(eventLoop.wakeupfd[1]) < 0) {
+    if (pipe2(eventLoop.wakeupfd, O_CLOEXEC | O_NONBLOCK) < 0) {
         virReportSystemError(errno, "%s",
                              _("Unable to setup wakeup pipe"));
         return -1;