I've been using the GNULIB poll() impl in libvirt on Win32 (well Mingw + WINE) and found it was producing really wierd results, such ret=-1 + errno=EAGAIN, or ret=0 even though requested timeout was infinite. After a little debugging I discovered a missing initialization of the 'rc' variable in the Win32 impl of poll(). With this patch applied, it is behaving as desired.
diff --git a/gnulib/lib/poll.c b/gnulib/lib/poll.c --- a/gnulib/lib/poll.c +++ b/gnulib/lib/poll.c @@ -405,7 +405,7 @@ poll (pfd, nfd, timeout) BOOL poll_again; MSG msg; char sockbuf[256]; - int rc; + int rc = 0; nfds_t i; if (nfd < 0 || timeout < -1) Regards, Daniel -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|