Module: wine Branch: master Commit: 65686b583bdfd5d152b487288747f4551d62d88b URL: http://source.winehq.org/git/wine.git/?a=commit;h=65686b583bdfd5d152b4872887...
Author: Kai Blin kai.blin@gmail.com Date: Mon Mar 24 17:05:47 2008 +0100
netapi32: Revert "janitorial: Use poll() instead of select()."
As Juan Lang pointed out, fd is a SOCKET here and the netapi32 call to select calls ws2_32.WS_select(), which uses poll internally already.
---
dlls/netapi32/nbt.c | 18 +++++------------- 1 files changed, 5 insertions(+), 13 deletions(-)
diff --git a/dlls/netapi32/nbt.c b/dlls/netapi32/nbt.c index 96309e4..1186572 100644 --- a/dlls/netapi32/nbt.c +++ b/dlls/netapi32/nbt.c @@ -67,15 +67,6 @@
#include "config.h" #include <stdarg.h> -#ifdef HAVE_POLL_H -#include <poll.h> -#endif -#ifdef HAVE_SYS_POLL_H -# include <sys/poll.h> -#endif -#ifdef HAVE_SYS_TIME_H -# include <sys/time.h> -#endif
#include "winsock2.h" #include "windef.h" @@ -311,12 +302,13 @@ static UCHAR NetBTWaitForNameResponse(const NetBTAdapter *adapter, SOCKET fd, while (!found && ret == NRC_GOODRET && (now = GetTickCount()) < waitUntil) { DWORD msToWait = waitUntil - now; - struct pollfd pfd; + struct fd_set fds; + struct timeval timeout = { msToWait / 1000, msToWait % 1000 }; int r;
- pfd.fd = fd; - pfd.events = POLLIN; - r = poll(&pfd, 1, msToWait); + FD_ZERO(&fds); + FD_SET(fd, &fds); + r = select(fd + 1, &fds, NULL, NULL, &timeout); if (r < 0) ret = NRC_SYSTEM; else if (r == 1)