Commit 474de350 authored by Bruce Momjian's avatar Bruce Momjian

FIx for unix domain sockets, from Goran Thyni.

parent 21261b03
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/libpq/pqcomm.c,v 1.27 1997/11/17 16:17:14 thomas Exp $ * $Header: /cvsroot/pgsql/src/backend/libpq/pqcomm.c,v 1.28 1997/11/19 17:52:00 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -607,8 +607,6 @@ StreamServerPort(char *hostName, short portName, int *fdP) ...@@ -607,8 +607,6 @@ StreamServerPort(char *hostName, short portName, int *fdP)
pqdebug("%s", PQerrormsg); pqdebug("%s", PQerrormsg);
return (STATUS_ERROR); return (STATUS_ERROR);
} }
if (family == AF_UNIX)
on_exitpg(do_unlink, (caddr_t) 0);
if ((setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, (char *) &one, if ((setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, (char *) &one,
sizeof(one))) == -1) sizeof(one))) == -1)
{ {
...@@ -641,6 +639,9 @@ StreamServerPort(char *hostName, short portName, int *fdP) ...@@ -641,6 +639,9 @@ StreamServerPort(char *hostName, short portName, int *fdP)
errno); errno);
pqdebug("%s", PQerrormsg); pqdebug("%s", PQerrormsg);
strcat(PQerrormsg, "\tIs another postmaster already running on that port?\n"); strcat(PQerrormsg, "\tIs another postmaster already running on that port?\n");
if (family == AF_UNIX)
strcat(PQerrormsg, "\tIf not, remove socket node (/tmp/.s.PGSQL.<portnr>)and retry.\n");
else
strcat(PQerrormsg, "\tIf not, wait a few seconds and retry.\n"); strcat(PQerrormsg, "\tIf not, wait a few seconds and retry.\n");
fputs(PQerrormsg, stderr); fputs(PQerrormsg, stderr);
return (STATUS_ERROR); return (STATUS_ERROR);
...@@ -657,6 +658,7 @@ StreamServerPort(char *hostName, short portName, int *fdP) ...@@ -657,6 +658,7 @@ StreamServerPort(char *hostName, short portName, int *fdP)
*/ */
*fdP = fd; *fdP = fd;
if (family == AF_UNIX) atexit(do_unlink);
return (STATUS_OK); return (STATUS_OK);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment