mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-22 04:25:18 +00: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:
parent
03ede2f69d
commit
da3c471467
2
.gnulib
2
.gnulib
@ -1 +1 @@
|
|||||||
Subproject commit 790645d837f8084991421107fba639b110d58335
|
Subproject commit dec3475763be252103922a887920012eeb32dc26
|
@ -49,6 +49,7 @@ mkstemp
|
|||||||
mkstemps
|
mkstemps
|
||||||
mktempd
|
mktempd
|
||||||
netdb
|
netdb
|
||||||
|
nonblocking
|
||||||
perror
|
perror
|
||||||
physmem
|
physmem
|
||||||
pipe-posix
|
pipe-posix
|
||||||
|
@ -77,6 +77,7 @@
|
|||||||
#include "verify.h"
|
#include "verify.h"
|
||||||
#include "files.h"
|
#include "files.h"
|
||||||
#include "command.h"
|
#include "command.h"
|
||||||
|
#include "nonblocking.h"
|
||||||
|
|
||||||
#ifndef NSIG
|
#ifndef NSIG
|
||||||
# define NSIG 32
|
# define NSIG 32
|
||||||
@ -246,26 +247,7 @@ virArgvToString(const char *const *argv)
|
|||||||
}
|
}
|
||||||
|
|
||||||
int virSetBlocking(int fd, bool blocking) {
|
int virSetBlocking(int fd, bool blocking) {
|
||||||
#ifndef WIN32
|
return set_nonblocking_flag (fd, !blocking);
|
||||||
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;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int virSetNonBlock(int fd) {
|
int virSetNonBlock(int fd) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user