提交 8ae5df5d 编写于 作者: E Eric Blake

virsh: fix mingw startup

* .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.
上级 02c39a2f
.gnulib @ bd5d1e62
Subproject commit f79652003534e496bca1e49922ca521f12ca8051 Subproject commit bd5d1e621103ea3f7fbae09010348ce2df563808
...@@ -54,6 +54,7 @@ nonblocking ...@@ -54,6 +54,7 @@ nonblocking
perror perror
physmem physmem
pipe-posix pipe-posix
pipe2
poll poll
posix-shell posix-shell
pthread pthread
......
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
#include <sys/time.h> #include <sys/time.h>
#include <errno.h> #include <errno.h>
#include <unistd.h> #include <unistd.h>
#include <fcntl.h>
#include "threads.h" #include "threads.h"
#include "logging.h" #include "logging.h"
...@@ -657,11 +658,7 @@ int virEventPollInit(void) ...@@ -657,11 +658,7 @@ int virEventPollInit(void)
return -1; return -1;
} }
if (pipe(eventLoop.wakeupfd) < 0 || if (pipe2(eventLoop.wakeupfd, O_CLOEXEC | O_NONBLOCK) < 0) {
virSetNonBlock(eventLoop.wakeupfd[0]) < 0 ||
virSetNonBlock(eventLoop.wakeupfd[1]) < 0 ||
virSetCloseExec(eventLoop.wakeupfd[0]) < 0 ||
virSetCloseExec(eventLoop.wakeupfd[1]) < 0) {
virReportSystemError(errno, "%s", virReportSystemError(errno, "%s",
_("Unable to setup wakeup pipe")); _("Unable to setup wakeup pipe"));
return -1; return -1;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册
新手
引导
客服 返回
顶部