Re: psql client does not handle WSAEWOULDBLOCK on Windows

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: Michael Paquier <michael@paquier.xyz>
Cc: Ning <ning94803@gmail.com>, pgsql-hackers@lists.postgresql.org, Andrew Dunstan <andrew@dunslane.net>
Date: 2025-10-05T19:14:44Z
Lists: pgsql-hackers

Attachments

I wrote:
> Michael Paquier <michael@paquier.xyz> writes:
>> Also, what about pqsecure_raw_write() in pqsecure_open_gss()?
>> Shouldn't the same check apply?

> Yeah, I think we pretty much need to use SOCK_ERRNO, SOCK_ERRNO_SET,
> and SOCK_STRERROR (if relevant) throughout fe-secure-gssapi.c.

Since nothing seems to be happening here, I took another look and
decided that the required changes are really pretty straightforward.
fe-secure-gssapi.c doesn't contain any strerror calls, and its
touches of errno all appear to relate to socket errors, so we can
just change them all.  As attached.

> Like you, I'm not really in a position to test this on Windows ...

I'm still not, but it's straightforward enough that I'm willing to
push on my own authority.  I'll just put this up for long enough
to make sure that the cfbot is happy with it --- though I think
it's not building with GSSAPI on Windows, so that may prove little.

			regards, tom lane

Commits

  1. Use SOCK_ERRNO[_SET] in fe-secure-gssapi.c.