mirror of
https://github.com/postgres/postgres.git
synced 2025-06-26 12:21:12 +03:00
libpq: use pgsocket for socket values, for portability
Previously, 'int' was used for socket values in libpq, but socket values are unsigned on Windows. This is a style correction. Initial patch and previous PGINVALID_SOCKET initial patch by Joel Jacobson, modified by me Report from PVS-Studio
This commit is contained in:
@ -604,7 +604,7 @@ pqReadData(PGconn *conn)
|
||||
int someread = 0;
|
||||
int nread;
|
||||
|
||||
if (conn->sock < 0)
|
||||
if (conn->sock == PGINVALID_SOCKET)
|
||||
{
|
||||
printfPQExpBuffer(&conn->errorMessage,
|
||||
libpq_gettext("connection not open\n"));
|
||||
@ -800,7 +800,7 @@ pqSendSome(PGconn *conn, int len)
|
||||
int remaining = conn->outCount;
|
||||
int result = 0;
|
||||
|
||||
if (conn->sock < 0)
|
||||
if (conn->sock == PGINVALID_SOCKET)
|
||||
{
|
||||
printfPQExpBuffer(&conn->errorMessage,
|
||||
libpq_gettext("connection not open\n"));
|
||||
@ -1011,7 +1011,7 @@ pqSocketCheck(PGconn *conn, int forRead, int forWrite, time_t end_time)
|
||||
|
||||
if (!conn)
|
||||
return -1;
|
||||
if (conn->sock < 0)
|
||||
if (conn->sock == PGINVALID_SOCKET)
|
||||
{
|
||||
printfPQExpBuffer(&conn->errorMessage,
|
||||
libpq_gettext("socket not open\n"));
|
||||
|
Reference in New Issue
Block a user