1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2025-10-20 11:33:43 +03:00

virsh: fix mingw failure on creating nonblocking pipe

* .gnulib: Update to latest, for nonblocking module.
* bootstrap.conf (gnulib_modules): Add nonblocking.
* src/util/util.c (virSetBlocking): Defer to gnulib.
This commit is contained in:
Eric Blake
2011-03-31 16:00:20 -06:00
parent 03ede2f69d
commit da3c471467
3 changed files with 4 additions and 21 deletions

Submodule .gnulib updated: 790645d837...dec3475763

View File

@@ -49,6 +49,7 @@ mkstemp
mkstemps
mktempd
netdb
nonblocking
perror
physmem
pipe-posix

View File

@@ -77,6 +77,7 @@
#include "verify.h"
#include "files.h"
#include "command.h"
#include "nonblocking.h"
#ifndef NSIG
# define NSIG 32
@@ -246,26 +247,7 @@ virArgvToString(const char *const *argv)
}
int virSetBlocking(int fd, bool blocking) {
#ifndef WIN32
int flags;
if ((flags = fcntl(fd, F_GETFL)) < 0)
return -1;
if (blocking)
flags &= ~O_NONBLOCK;
else
flags |= O_NONBLOCK;
if ((fcntl(fd, F_SETFL, flags)) < 0)
return -1;
#else
unsigned long flag = blocking ? 0 : 1;
/* This is actually Gnulib's replacement rpl_ioctl function.
* We can't call ioctlsocket directly in any case.
*/
if (ioctl (fd, FIONBIO, (void *) &flag) == -1)
return -1;
#endif
return 0;
return set_nonblocking_flag (fd, !blocking);
}
int virSetNonBlock(int fd) {