77 *
88 *
99 * IDENTIFICATION
10- * $Header: /cvsroot/pgsql/src/backend/libpq/pqcomm.c,v 1.27 1997/11/17 16: 17:14 thomas Exp $
10+ * $Header: /cvsroot/pgsql/src/backend/libpq/pqcomm.c,v 1.28 1997/11/19 17:52:00 momjian Exp $
1111 *
1212 *-------------------------------------------------------------------------
1313 */
@@ -607,8 +607,6 @@ StreamServerPort(char *hostName, short portName, int *fdP)
607607 pqdebug ("%s" , PQerrormsg );
608608 return (STATUS_ERROR );
609609 }
610- if (family == AF_UNIX )
611- on_exitpg (do_unlink , (caddr_t ) 0 );
612610 if ((setsockopt (fd , SOL_SOCKET , SO_REUSEADDR , (char * ) & one ,
613611 sizeof (one ))) == -1 )
614612 {
@@ -636,14 +634,17 @@ StreamServerPort(char *hostName, short portName, int *fdP)
636634 err = bind (fd , (struct sockaddr * ) & saddr , len );
637635 if (err < 0 )
638636 {
639- sprintf (PQerrormsg ,
640- "FATAL: StreamServerPort: bind() failed: errno=%d\n" ,
641- errno );
642- pqdebug ("%s" , PQerrormsg );
643- strcat (PQerrormsg , "\tIs another postmaster already running on that port?\n" );
644- strcat (PQerrormsg , "\tIf not, wait a few seconds and retry.\n" );
645- fputs (PQerrormsg , stderr );
646- return (STATUS_ERROR );
637+ sprintf (PQerrormsg ,
638+ "FATAL: StreamServerPort: bind() failed: errno=%d\n" ,
639+ errno );
640+ pqdebug ("%s" , PQerrormsg );
641+ strcat (PQerrormsg , "\tIs another postmaster already running on that port?\n" );
642+ if (family == AF_UNIX )
643+ strcat (PQerrormsg , "\tIf not, remove socket node (/tmp/.s.PGSQL.<portnr>)and retry.\n" );
644+ else
645+ strcat (PQerrormsg , "\tIf not, wait a few seconds and retry.\n" );
646+ fputs (PQerrormsg , stderr );
647+ return (STATUS_ERROR );
647648 }
648649
649650 listen (fd , SOMAXCONN );
@@ -657,6 +658,7 @@ StreamServerPort(char *hostName, short portName, int *fdP)
657658 */
658659
659660 * fdP = fd ;
661+ if (family == AF_UNIX ) atexit (do_unlink );
660662 return (STATUS_OK );
661663}
662664
0 commit comments