From 65686b583bdfd5d152b487288747f4551d62d88b Mon Sep 17 00:00:00 2001 From: Kai Blin Date: Mon, 24 Mar 2008 17:05:47 +0100 Subject: [PATCH] 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 file changed, 5 insertions(+), 13 deletions(-) diff --git a/dlls/netapi32/nbt.c b/dlls/netapi32/nbt.c index 96309e40376..1186572dab7 100644 --- a/dlls/netapi32/nbt.c +++ b/dlls/netapi32/nbt.c @@ -67,15 +67,6 @@ #include "config.h" #include -#ifdef HAVE_POLL_H -#include -#endif -#ifdef HAVE_SYS_POLL_H -# include -#endif -#ifdef HAVE_SYS_TIME_H -# include -#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)