summaryrefslogtreecommitdiff
path: root/src/backend/postmaster
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/postmaster')
-rw-r--r--src/backend/postmaster/postmaster.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/backend/postmaster/postmaster.c b/src/backend/postmaster/postmaster.c
index 8a2cc2fc2b4..2b2b993e2cf 100644
--- a/src/backend/postmaster/postmaster.c
+++ b/src/backend/postmaster/postmaster.c
@@ -74,8 +74,6 @@
#include <sys/socket.h>
#include <fcntl.h>
#include <sys/param.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
#include <netdb.h>
#include <limits.h>
@@ -107,6 +105,7 @@
#include "miscadmin.h"
#include "pg_getopt.h"
#include "pgstat.h"
+#include "port/pg_bswap.h"
#include "postmaster/autovacuum.h"
#include "postmaster/bgworker_internals.h"
#include "postmaster/fork_process.h"
@@ -1072,7 +1071,7 @@ PostmasterMain(int argc, char *argv[])
"_postgresql._tcp.",
NULL,
NULL,
- htons(PostPortNumber),
+ pg_hton16(PostPortNumber),
0,
NULL,
NULL,
@@ -1966,7 +1965,7 @@ ProcessStartupPacket(Port *port, bool SSLdone)
return STATUS_ERROR;
}
- len = ntohl(len);
+ len = pg_ntoh32(len);
len -= 4;
if (len < (int32) sizeof(ProtocolVersion) ||
@@ -2002,7 +2001,7 @@ ProcessStartupPacket(Port *port, bool SSLdone)
* The first field is either a protocol version number or a special
* request code.
*/
- port->proto = proto = ntohl(*((ProtocolVersion *) buf));
+ port->proto = proto = pg_ntoh32(*((ProtocolVersion *) buf));
if (proto == CANCEL_REQUEST_CODE)
{
@@ -2281,8 +2280,8 @@ processCancelRequest(Port *port, void *pkt)
int i;
#endif
- backendPID = (int) ntohl(canc->backendPID);
- cancelAuthCode = (int32) ntohl(canc->cancelAuthCode);
+ backendPID = (int) pg_ntoh32(canc->backendPID);
+ cancelAuthCode = (int32) pg_ntoh32(canc->cancelAuthCode);
/*
* See if we have a matching backend. In the EXEC_BACKEND case, we can no