Hi, commit 63504e9e80acb35666f8689526c67dd99c4fb3ba (janitorial: Use poll() instead of select().) appears to confuse the use of a SOCKET with an int:
#include "winsock2.h" #include "windef.h" @@ -302,13 +311,12 @@ static UCHAR NetBTWaitForNameResponse(const NetBTAdapter *adapter, SOCKET fd, while (!found && ret == NRC_GOODRET && (now = GetTickCount()) < waitUntil) { DWORD msToWait = waitUntil - now; - struct fd_set fds; - struct timeval timeout = { msToWait / 1000, msToWait % 1000 }; + struct pollfd pfd; int r;
- FD_ZERO(&fds); - FD_SET(fd, &fds); - r = select(fd + 1, &fds, NULL, NULL, &timeout); + pfd.fd = fd; + pfd.events = POLLIN; + r = poll(&pfd, 1, msToWait);
I can't imagine how this could work. Notice that netapi32 is linked against ws2_32, includes winsock2.h, and that fd is a SOCKET. Could this part of the commit be reverted, please? --Juan
On Monday 24 March 2008 16:32:29 Juan Lang wrote:
Hi, commit 63504e9e80acb35666f8689526c67dd99c4fb3ba (janitorial: Use poll() instead of select().) appears to confuse the use of a SOCKET with an int:
D'oh, you're right. I've sent a partial revert for this. Seems like that part isn't tested, as make test in netapi32 worked without any problems.
Thanks for the catch, Kai
D'oh, you're right. I've sent a partial revert for this. Seems like that part isn't tested, as make test in netapi32 worked without any problems.
Right, there isn't any way to test it. We can't run NBT servers in Wine as normal users (requires a low port #, conflicts with Samba), and we can't count on an external server being present.
--Juan