Re: [HACKERS] SunOS patches - Mailing list pgsql-hackers
From | t-ishii@sra.co.jp |
---|---|
Subject | Re: [HACKERS] SunOS patches |
Date | |
Msg-id | 199803020524.OAA14799@srapc451.sra.co.jp Whole thread Raw |
In response to | Re: [HACKERS] SunOS patches (t-ishii@sra.co.jp) |
Responses |
Re: [HACKERS] SunOS patches
|
List | pgsql-hackers |
>>On Mon, 2 Mar 1998, Thomas G. Lockhart wrote: >> >>> gcc -I../../include -I../../backend -I/usr/include/ncurses >>> -I/usr/include/readline -O2 -m486 -Wall -Wmissing-prototypes -I.. -c >>> pqcomm.c -o pqcomm.o >>> pqcomm.c:569: warning: no previous prototype for `StreamDoUnlink' >>> ... >>> ipc.c: In function `exitpg': >>> ipc.c:139: warning: implicit declaration of function `StreamDoUnlink' >>> >>> Seems to run OK though. Would like to get the warnings out of there for a >>> release. I didn't pay attention to Tatsuo's earlier patches since they didn't >>> directly affect my platform; where would these things be declared? Can Tatsuo >>> come up with a few more patches to fix this up? It would be worth waiting a few >>> hours on the release to get SunOS in there (the docs claim it is supported :) >> >> What he said... :) >> >> Tatsuo...could you send me a clean patch that fixes the above and >>includes the last patch? I'll end up scrutinizing it in the morning, most >>likely, before applying it, but it would be nice to get it in before I >>bundle things... >> >> As long as I'm confident that it won't affect anything or anyone >>else :) > >Please give me an hour. I will work on this now. Here it is. (Mar 1 snapshot seems to lack the pacthes to include/libpq/pqcomm.h. so I included that also.) ----------------------------- cut here ----------------------------- *** include/libpq/libpq.h.orig Thu Feb 26 17:02:21 1998 --- include/libpq/libpq.h Mon Mar 2 13:16:06 1998 *************** *** 282,286 **** --- 282,287 ---- extern int StreamServerPort(char *hostName, short portName, int *fdP); extern int StreamConnection(int server_fd, Port *port); extern void StreamClose(int sock); + extern void StreamDoUnlink(void); #endif /* LIBPQ_H */ *** include/libpq/pqcomm.h.orig Mon Mar 2 13:55:19 1998 --- include/libpq/pqcomm.h Mon Mar 2 13:57:10 1998 *************** *** 35,42 **** /* Configure the UNIX socket address for the well known port. */ #define UNIXSOCK_PATH(sun,port) \ ! (sprintf((sun).sun_path, "/tmp/.s.PGSQL.%d", (port)) + \ ! offsetof(struct sockaddr_un, sun_path)) /* * We do this because sun_len is in BSD's struct, while others don't. * We never actually set BSD's sun_len, and I can't think of a --- 35,43 ---- /* Configure the UNIX socket address for the well known port. */ #define UNIXSOCK_PATH(sun,port) \ ! (sprintf((sun).sun_path, "/tmp/.s.PGSQL.%d", (port)), \ ! strlen((sun).sun_path)+ offsetof(struct sockaddr_un, sun_path)) ! /* * We do this because sun_len is in BSD's struct, while others don't. * We never actually set BSD's sun_len, and I can't think of a *** backend/libpq/pqcomm.c.orig Thu Feb 26 17:01:05 1998 --- backend/libpq/pqcomm.c Mon Mar 2 13:16:06 1998 *************** *** 564,571 **** * Shutdown routine for backend connection * If a Unix socket is used for communication, explicitly close it. */ ! static void ! do_unlink() { if (sock_path[0]) unlink(sock_path); --- 564,571 ---- * Shutdown routine for backend connection * If a Unix socket is used for communication, explicitly close it. */ ! void ! StreamDoUnlink() { if (sock_path[0]) unlink(sock_path); *************** *** 645,651 **** if (family == AF_UNIX) { chmod(sock_path, 0777); - atexit(do_unlink); } return (STATUS_OK); } --- 645,650 ---- *** backend/storage/ipc/ipc.c.orig Thu Feb 26 17:01:36 1998 --- backend/storage/ipc/ipc.c Mon Mar 2 13:16:06 1998 *************** *** 38,43 **** --- 38,44 ---- #include <sys/sem.h> #include <sys/shm.h> #include "utils/memutils.h" + #include "libpq/libpq.h" #if defined(sparc_solaris) #include <string.h> *************** *** 136,141 **** --- 137,143 ---- for (i = onexit_index - 1; i >= 0; --i) (*onexit_list[i].function) (code, onexit_list[i].arg); + StreamDoUnlink(); exit(code); }
pgsql-hackers by date: