Le vendredi 12 septembre 2008 à 06:34 +0200, Paolo Bonzini a écrit : > Bruno Haible wrote: > > Yoann Vandoorselaere wrote: > >> r = recv (pfd[i].fd, data, sizeof (data), MSG_PEEK); > >> + > >> +# ifdef WIN32 > >> + if (r < 0 && GetLastError() == 10057) /* server socket */ > >> + socket_errno = ENOTCONN; > >> + else > >> +# endif > > > > I thought that after using a winsock function, you need to check > > WSAGetLastError() and not GetLastError()? [1] > > > > Also, is there no symbolic, self-explanatory name instead of 10057? > > It is temporary anyway; Yoann seems to be the main user of poll on Win32 > and if he helps testing the native implementation, it will get in sooner.
I tried updating the poll module with your patch, but it's not compiling: poll.c:89: error: expected declaration specifiers or ‘...’ before ‘FILE_INFORMATION_CLASS’ poll.c: In function ‘win32_compute_revents’: poll.c:137: error: too many arguments to function ‘NtQueryInformationFile’ poll.c:151: warning: implicit declaration of function ‘alloca’ poll.c:151: warning: incompatible implicit declaration of built-in function ‘alloca’ -- Yoann Vandoorselaere | Responsable R&D / CTO | PreludeIDS Technologies Tel: +33 (0)8 70 70 21 58 Fax: +33(0)4 78 42 21 58 http://www.prelude-ids.com