diff options
Diffstat (limited to 'src/backend/commands/copy.c')
-rw-r--r-- | src/backend/commands/copy.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/backend/commands/copy.c b/src/backend/commands/copy.c index 7c004ffad8a..e87588040fa 100644 --- a/src/backend/commands/copy.c +++ b/src/backend/commands/copy.c @@ -17,8 +17,6 @@ #include <ctype.h> #include <unistd.h> #include <sys/stat.h> -#include <netinet/in.h> -#include <arpa/inet.h> #include "access/heapam.h" #include "access/htup_details.h" @@ -38,6 +36,7 @@ #include "optimizer/planner.h" #include "nodes/makefuncs.h" #include "parser/parse_relation.h" +#include "port/pg_bswap.h" #include "rewrite/rewriteHandler.h" #include "storage/fd.h" #include "tcop/tcopprot.h" @@ -671,7 +670,7 @@ CopySendInt32(CopyState cstate, int32 val) { uint32 buf; - buf = htonl((uint32) val); + buf = pg_hton32((uint32) val); CopySendData(cstate, &buf, sizeof(buf)); } @@ -690,7 +689,7 @@ CopyGetInt32(CopyState cstate, int32 *val) *val = 0; /* suppress compiler warning */ return false; } - *val = (int32) ntohl(buf); + *val = (int32) pg_ntoh32(buf); return true; } @@ -702,7 +701,7 @@ CopySendInt16(CopyState cstate, int16 val) { uint16 buf; - buf = htons((uint16) val); + buf = pg_hton16((uint16) val); CopySendData(cstate, &buf, sizeof(buf)); } @@ -719,7 +718,7 @@ CopyGetInt16(CopyState cstate, int16 *val) *val = 0; /* suppress compiler warning */ return false; } - *val = (int16) ntohs(buf); + *val = (int16) pg_ntoh16(buf); return true; } |