"Merlin Moncure" <merlin.moncure@rcsonline.com> writes:
> if (ret < 0)
> {
> int wsa_errno;
> wsa_errno = WSAGetLastError();
> if (WSAECONNRESET == wsa_errno)
> { /* EOF on the pipe! (win32 socket based implementation) */
> ret = 0;
> }
> else
> {
> errno = wsa_errno; /* this *might* be ok */
> }
> }
> Maybe Magnus might comment here. This doesn't explain why the read call
> is failing but I'm pretty sure the error code is not being properly
> returned.
I recall a lot of angst about whether the encoding of WSAGetLastError()
is compatible with errno values, but I forget what the conclusion was.
Can we just assign to errno like that, or do we need a mapping function?
regards, tom lane