diff options
Diffstat (limited to 'src/interfaces/libpq/fe-connect.c')
-rw-r--r-- | src/interfaces/libpq/fe-connect.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/interfaces/libpq/fe-connect.c b/src/interfaces/libpq/fe-connect.c index c580d91135a..5f798036071 100644 --- a/src/interfaces/libpq/fe-connect.c +++ b/src/interfaces/libpq/fe-connect.c @@ -47,7 +47,6 @@ #ifdef HAVE_NETINET_TCP_H #include <netinet/tcp.h> #endif -#include <arpa/inet.h> #endif #ifdef ENABLE_THREAD_SAFETY @@ -73,6 +72,7 @@ static int ldapServiceLookup(const char *purl, PQconninfoOption *options, #include "common/ip.h" #include "mb/pg_wchar.h" +#include "port/pg_bswap.h" #ifndef WIN32 @@ -2443,7 +2443,7 @@ keep_going: /* We will come back to here until there is * shouldn't since we only got here if the socket is * write-ready. */ - pv = htonl(NEGOTIATE_SSL_CODE); + pv = pg_hton32(NEGOTIATE_SSL_CODE); if (pqPacketSend(conn, 0, &pv, sizeof(pv)) != STATUS_OK) { appendPQExpBuffer(&conn->errorMessage, @@ -3838,10 +3838,10 @@ retry3: /* Create and send the cancel request packet. */ - crp.packetlen = htonl((uint32) sizeof(crp)); - crp.cp.cancelRequestCode = (MsgType) htonl(CANCEL_REQUEST_CODE); - crp.cp.backendPID = htonl(be_pid); - crp.cp.cancelAuthCode = htonl(be_key); + crp.packetlen = pg_hton32((uint32) sizeof(crp)); + crp.cp.cancelRequestCode = (MsgType) pg_hton32(CANCEL_REQUEST_CODE); + crp.cp.backendPID = pg_hton32(be_pid); + crp.cp.cancelAuthCode = pg_hton32(be_key); retry4: if (send(tmpsock, (char *) &crp, sizeof(crp), 0) != (int) sizeof(crp)) |