Handle fstat() of a socket descriptor.
commitb49fa05b92a7a369beca1de67fded5a6da500f9c
authorJohannes Sixt <johannes.sixt@telecom.at>
Thu, 20 Sep 2007 12:58:00 +0000 (20 14:58 +0200)
committerJohannes Sixt <johannes.sixt@telecom.at>
Fri, 21 Sep 2007 19:36:15 +0000 (21 21:36 +0200)
treed6418047b8c3bb63985a5c8bb4eda1446f66aeab
parent0cce83445cb03b9ae93c2f7f3427e0ca2063dc73
Handle fstat() of a socket descriptor.

GetFileInformationByHandle() fails if it is passed a WinSock handle.
Fortunately, the failure can be distinguished by the error code, and we
can in this case pretend that the fstat() was actually successful.

This is a valid thing to do: Calling fstat() on a descriptor makes only
sense if either the caller needs information on the file (in which case
we would not reach this error condition), or if it wants to distinguish
a socket from a file (which implies that the caller will have to test
st_mode, which happens to be the only field that we can fill in).

Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>
compat/mingw.c