diff options
| author | Magnus Hagander <magnus@hagander.net> | 2010-01-10 14:16:08 +0000 |
|---|---|---|
| committer | Magnus Hagander <magnus@hagander.net> | 2010-01-10 14:16:08 +0000 |
| commit | 87091cb1f1ed914e2ddca424fa28f94fdf8461d2 (patch) | |
| tree | ec717192f02f29f0f2a7b602e0020d43fc584f61 /src/include/libpq | |
| parent | 84b6d5f35941a0406210e7938d10c3cce4e11340 (diff) | |
| download | postgresql-87091cb1f1ed914e2ddca424fa28f94fdf8461d2.tar.gz | |
Create typedef pgsocket for storing socket descriptors.
This silences some warnings on Win64. Not using the proper SOCKET datatype
was actually wrong on Win32 as well, but didn't cause any warnings there.
Also create define PGINVALID_SOCKET to indicate an invalid/non-existing
socket, instead of using a hardcoded -1 value.
Diffstat (limited to 'src/include/libpq')
| -rw-r--r-- | src/include/libpq/libpq-be.h | 4 | ||||
| -rw-r--r-- | src/include/libpq/libpq.h | 8 |
2 files changed, 6 insertions, 6 deletions
diff --git a/src/include/libpq/libpq-be.h b/src/include/libpq/libpq-be.h index c714add81a..1d35871528 100644 --- a/src/include/libpq/libpq-be.h +++ b/src/include/libpq/libpq-be.h @@ -11,7 +11,7 @@ * Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/libpq/libpq-be.h,v 1.72 2010/01/02 16:58:04 momjian Exp $ + * $PostgreSQL: pgsql/src/include/libpq/libpq-be.h,v 1.73 2010/01/10 14:16:08 mha Exp $ * *------------------------------------------------------------------------- */ @@ -103,7 +103,7 @@ typedef struct typedef struct Port { - int sock; /* File descriptor */ + pgsocket sock; /* File descriptor */ ProtocolVersion proto; /* FE/BE protocol version */ SockAddr laddr; /* local addr (postmaster) */ SockAddr raddr; /* remote addr (client) */ diff --git a/src/include/libpq/libpq.h b/src/include/libpq/libpq.h index 314ce69bce..c9c7e0d764 100644 --- a/src/include/libpq/libpq.h +++ b/src/include/libpq/libpq.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/libpq/libpq.h,v 1.72 2010/01/02 16:58:04 momjian Exp $ + * $PostgreSQL: pgsql/src/include/libpq/libpq.h,v 1.73 2010/01/10 14:16:08 mha Exp $ * *------------------------------------------------------------------------- */ @@ -45,10 +45,10 @@ typedef struct * prototypes for functions in pqcomm.c */ extern int StreamServerPort(int family, char *hostName, - unsigned short portNumber, char *unixSocketName, int ListenSocket[], + unsigned short portNumber, char *unixSocketName, pgsocket ListenSocket[], int MaxListen); -extern int StreamConnection(int server_fd, Port *port); -extern void StreamClose(int sock); +extern int StreamConnection(pgsocket server_fd, Port *port); +extern void StreamClose(pgsocket sock); extern void TouchSocketFile(void); extern void pq_init(void); extern void pq_comm_reset(void); |
