mirror of
https://git.postgresql.org/git/postgresql.git
synced 2025-02-23 19:39:53 +08:00
Use correct format placeholder for WSAGetLastError()
Some code thought this was unsigned, but it's signed int.
This commit is contained in:
parent
6bbcff096f
commit
9486844f30
@ -1594,7 +1594,7 @@ pq_setkeepaliveswin32(Port *port, int idle, int interval)
|
||||
!= 0)
|
||||
{
|
||||
ereport(LOG,
|
||||
(errmsg("WSAIoctl(%s) failed: %ui",
|
||||
(errmsg("WSAIoctl(%s) failed: %d",
|
||||
"SIO_KEEPALIVE_VALS", WSAGetLastError())));
|
||||
return STATUS_ERROR;
|
||||
}
|
||||
|
@ -635,7 +635,7 @@ pgwin32_select(int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, c
|
||||
{
|
||||
ZeroMemory(&resEvents, sizeof(resEvents));
|
||||
if (WSAEnumNetworkEvents(sockets[i], events[i], &resEvents) != 0)
|
||||
elog(ERROR, "failed to enumerate network events: error code %u",
|
||||
elog(ERROR, "failed to enumerate network events: error code %d",
|
||||
WSAGetLastError());
|
||||
/* Read activity? */
|
||||
if (readfds && FD_ISSET(sockets[i], readfds))
|
||||
|
@ -1280,11 +1280,11 @@ WaitEventAdjustWin32(WaitEventSet *set, WaitEvent *event)
|
||||
{
|
||||
*handle = WSACreateEvent();
|
||||
if (*handle == WSA_INVALID_EVENT)
|
||||
elog(ERROR, "failed to create event for socket: error code %u",
|
||||
elog(ERROR, "failed to create event for socket: error code %d",
|
||||
WSAGetLastError());
|
||||
}
|
||||
if (WSAEventSelect(event->fd, *handle, flags) != 0)
|
||||
elog(ERROR, "failed to set up event for socket: error code %u",
|
||||
elog(ERROR, "failed to set up event for socket: error code %d",
|
||||
WSAGetLastError());
|
||||
|
||||
Assert(event->fd != PGINVALID_SOCKET);
|
||||
@ -1971,7 +1971,7 @@ WaitEventSetWaitBlock(WaitEventSet *set, int cur_timeout,
|
||||
|
||||
ZeroMemory(&resEvents, sizeof(resEvents));
|
||||
if (WSAEnumNetworkEvents(cur_event->fd, handle, &resEvents) != 0)
|
||||
elog(ERROR, "failed to enumerate network events: error code %u",
|
||||
elog(ERROR, "failed to enumerate network events: error code %d",
|
||||
WSAGetLastError());
|
||||
if ((cur_event->events & WL_SOCKET_READABLE) &&
|
||||
(resEvents.lNetworkEvents & FD_READ))
|
||||
|
@ -1985,7 +1985,7 @@ setKeepalivesWin32(PGconn *conn)
|
||||
!= 0)
|
||||
{
|
||||
appendPQExpBuffer(&conn->errorMessage,
|
||||
libpq_gettext("WSAIoctl(SIO_KEEPALIVE_VALS) failed: %ui\n"),
|
||||
libpq_gettext("WSAIoctl(SIO_KEEPALIVE_VALS) failed: %d\n"),
|
||||
WSAGetLastError());
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user