Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit6a9627e

Browse files
committed
Last minute clean up for SunOS...
From: t-ishii@sra.co.jp
1 parent86d1343 commit6a9627e

File tree

4 files changed

+12
-9
lines changed

4 files changed

+12
-9
lines changed

‎src/backend/libpq/pqcomm.c‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/libpq/pqcomm.c,v 1.39 1998/02/26 04:31:53momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/libpq/pqcomm.c,v 1.40 1998/03/02 05:41:53scrappy Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -564,8 +564,8 @@ static char sock_path[MAXPGPATH + 1] = "";
564564
* Shutdown routine for backend connection
565565
* If a Unix socket is used for communication, explicitly close it.
566566
*/
567-
staticvoid
568-
do_unlink()
567+
void
568+
StreamDoUnlink()
569569
{
570570
if (sock_path[0])
571571
unlink(sock_path);
@@ -645,7 +645,6 @@ StreamServerPort(char *hostName, short portName, int *fdP)
645645
if (family==AF_UNIX)
646646
{
647647
chmod(sock_path,0777);
648-
atexit(do_unlink);
649648
}
650649
return (STATUS_OK);
651650
}

‎src/backend/storage/ipc/ipc.c‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/storage/ipc/ipc.c,v 1.19 1998/02/26 04:35:38 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/storage/ipc/ipc.c,v 1.20 1998/03/02 05:41:55 scrappy Exp $
1111
*
1212
* NOTES
1313
*
@@ -38,6 +38,7 @@
3838
#include<sys/sem.h>
3939
#include<sys/shm.h>
4040
#include"utils/memutils.h"
41+
#include"libpq/libpq.h"
4142

4243
#if defined(sparc_solaris)
4344
#include<string.h>
@@ -136,6 +137,7 @@ exitpg(int code)
136137
for (i=onexit_index-1;i >=0;--i)
137138
(*onexit_list[i].function) (code,onexit_list[i].arg);
138139

140+
StreamDoUnlink();
139141
exit(code);
140142
}
141143

‎src/include/libpq/libpq.h‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*
77
* Copyright (c) 1994, Regents of the University of California
88
*
9-
* $Id: libpq.h,v 1.12 1998/02/26 04:41:51 momjian Exp $
9+
* $Id: libpq.h,v 1.13 1998/03/02 05:42:06 scrappy Exp $
1010
*
1111
*-------------------------------------------------------------------------
1212
*/
@@ -282,5 +282,6 @@ extern void pq_async_notify(void);
282282
externintStreamServerPort(char*hostName,shortportName,int*fdP);
283283
externintStreamConnection(intserver_fd,Port*port);
284284
externvoidStreamClose(intsock);
285+
externvoidStreamDoUnlink(void);
285286

286287
#endif/* LIBPQ_H */

‎src/include/libpq/pqcomm.h‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*
77
* Copyright (c) 1994, Regents of the University of California
88
*
9-
* $Id: pqcomm.h,v 1.23 1998/02/26 04:41:53 momjian Exp $
9+
* $Id: pqcomm.h,v 1.24 1998/03/02 05:42:15 scrappy Exp $
1010
*
1111
*-------------------------------------------------------------------------
1212
*/
@@ -35,8 +35,9 @@ typedef union SockAddr
3535
/* Configure the UNIX socket address for the well known port. */
3636

3737
#defineUNIXSOCK_PATH(sun,port) \
38-
(sprintf((sun).sun_path, "/tmp/.s.PGSQL.%d", (port)) + \
39-
offsetof(struct sockaddr_un, sun_path))
38+
(sprintf((sun).sun_path, "/tmp/.s.PGSQL.%d", (port)), \
39+
strlen((sun).sun_path)+ offsetof(struct sockaddr_un, sun_path))
40+
4041
/*
4142
*We do this because sun_len is in BSD's struct, while others don't.
4243
*We never actually set BSD's sun_len, and I can't think of a

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp