https://bugs.winehq.org/show_bug.cgi?id=51232
Bug ID: 51232 Summary: calling WsaGetLastError() after calling getsockopt() with a file descriptor that is not a socket differs from Windows Product: Wine Version: 5.0.3 Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: -unknown Assignee: wine-bugs@winehq.org Reporter: michaela@molthagen.de Distribution: ---
Program: ZOC Terminal 8.02.4 (x64)
int err, rc, type= 0, fd; socklen_t type_len= sizeof(type); fd= open("C:\somefile.txt", O_RDONLY); if (fd==-1) return; // fd is now a file descriptor for a file, not a socket. rc= getsockopt(fd, SOL_SOCKET, SO_TYPE, (char *)&type, &type_len); err= WSAGetLastError(); notasocket= (rc==-1 &&(err==WSAENOTSOCK); // notasocket is now FALSE, because Windows returns WSAENOTSOCK, but Wine returns WSAEBADF // Linux returns ENOTSOCK, so the Windows WSAENOTSOCK is the best representation of that
https://bugs.winehq.org/show_bug.cgi?id=51232
Sagawa sagawa.aki+winebugs@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |sagawa.aki+winebugs@gmail.c | |om
--- Comment #1 from Sagawa sagawa.aki+winebugs@gmail.com --- It should be fixed by commit ffe20add5812fc45267af22aaa2af7d4e9a39d0e . Could you try with the patch or the next release (guess Wine 6.16)?