summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
Diffstat (limited to 'src/include')
-rw-r--r--src/include/libpq/libpq-be.h4
-rw-r--r--src/include/libpq/libpq.h8
-rw-r--r--src/include/port.h15
3 files changed, 18 insertions, 9 deletions
diff --git a/src/include/libpq/libpq-be.h b/src/include/libpq/libpq-be.h
index c714add81a3..1d358715288 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 314ce69bce4..c9c7e0d7640 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);
diff --git a/src/include/port.h b/src/include/port.h
index b5c22cb0c4c..2a4f9b4818a 100644
--- a/src/include/port.h
+++ b/src/include/port.h
@@ -6,7 +6,7 @@
* Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/port.h,v 1.128 2010/01/02 16:58:00 momjian Exp $
+ * $PostgreSQL: pgsql/src/include/port.h,v 1.129 2010/01/10 14:16:08 mha Exp $
*
*-------------------------------------------------------------------------
*/
@@ -17,9 +17,18 @@
#include <netdb.h>
#include <pwd.h>
+/* socket has a different definition on WIN32 */
+#ifndef WIN32
+typedef int pgsocket;
+#define PGINVALID_SOCKET -1
+#else
+typedef SOCKET pgsocket;
+#define PGINVALID_SOCKET INVALID_SOCKET
+#endif
+
/* non-blocking */
-extern bool pg_set_noblock(int sock);
-extern bool pg_set_block(int sock);
+extern bool pg_set_noblock(pgsocket sock);
+extern bool pg_set_block(pgsocket sock);
/* Portable path handling for Unix/Win32 (in path.c) */