1
0
mirror of https://github.com/postgres/postgres.git synced 2025-11-10 17:42:29 +03:00

Use closesocket() for all socket/pipe closing, because Win32 requires

it, and map that to close() on Unix.
This commit is contained in:
Bruce Momjian
2003-04-25 01:24:00 +00:00
parent 5f677af2da
commit db7e46a76d
8 changed files with 33 additions and 52 deletions

View File

@@ -30,7 +30,7 @@
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* $Header: /cvsroot/pgsql/src/backend/libpq/pqcomm.c,v 1.151 2003/04/22 00:08:06 tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/libpq/pqcomm.c,v 1.152 2003/04/25 01:24:00 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -150,7 +150,7 @@ pq_close(void)
if (MyProcPort != NULL)
{
secure_close(MyProcPort);
close(MyProcPort->sock);
closesocket(MyProcPort->sock);
/* make sure any subsequent attempts to do I/O fail cleanly */
MyProcPort->sock = -1;
}
@@ -228,7 +228,7 @@ StreamServerPort(int family, char *hostName, unsigned short portNumber,
snprintf(portNumberStr, sizeof(portNumberStr), "%d", portNumber);
service = portNumberStr;
}
ret = getaddrinfo2(hostName, service, &hint, &addrs);
if (ret || addrs == NULL)
{
@@ -470,7 +470,7 @@ StreamConnection(int server_fd, Port *port)
void
StreamClose(int sock)
{
close(sock);
closesocket(sock);
}
/*