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

Commita5494a2

Browse files
committed
Various patches for nextstep by GregorHoffleit
Replaced NEED_STRDUP by !HAVE_STRDUP
1 parent809ae06 commita5494a2

File tree

7 files changed

+51
-16
lines changed

7 files changed

+51
-16
lines changed

‎src/backend/postmaster/postmaster.c

Lines changed: 33 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
*
1111
*
1212
* IDENTIFICATION
13-
* $Header: /cvsroot/pgsql/src/backend/postmaster/postmaster.c,v 1.38 1997/02/06 19:27:22 momjian Exp $
13+
* $Header: /cvsroot/pgsql/src/backend/postmaster/postmaster.c,v 1.39 1997/02/13 08:31:09 scrappy Exp $
1414
*
1515
* NOTES
1616
*
@@ -420,12 +420,16 @@ pmdaemonize(void)
420420

421421
if (fork())
422422
exit(0);
423-
423+
/* GH: If there's no setsid(), we hopefully don't need silent mode.
424+
* Until there's a better solution.
425+
*/
426+
#ifdefHAVE_SETSID
424427
if (setsid()<0) {
425428
fprintf(stderr,"%s: ",progname);
426429
perror("cannot disassociate from controlling TTY");
427430
exit(1);
428431
}
432+
#endif
429433
i=open(NULL_DEV,O_RDWR);
430434
(void)dup2(i,0);
431435
(void)dup2(i,1);
@@ -459,19 +463,30 @@ ServerLoop(void)
459463
fd_setrmask,basemask;
460464
intnSockets,nSelected,status,newFd;
461465
Dlelem*next,*curr;
462-
/* int orgsigmask = sigblock(0); */
466+
/* GH: For !HAVE_SIGPROCMASK (NEXTSTEP), TRH implemented
467+
* an alternative interface.
468+
*/
469+
#ifdefHAVE_SIGPROCMASK
463470
sigset_toldsigmask,newsigmask;
471+
#else
472+
intorgsigmask=sigblock(0);
473+
#endif
464474

465475
nSockets=ServerSock+1;
466476
FD_ZERO(&basemask);
467477
FD_SET(ServerSock,&basemask);
468478

479+
#ifdefHAVE_SIGPROCMASK
469480
sigprocmask(0,0,&oldsigmask);
470481
sigemptyset(&newsigmask);
471482
sigaddset(&newsigmask,SIGCHLD);
483+
#endif
472484
for (;;) {
473-
/* sigsetmask(orgsigmask); */
485+
#ifdefHAVE_SIGPROCMASK
474486
sigprocmask(SIG_SETMASK,&oldsigmask,0);
487+
#else
488+
sigsetmask(orgsigmask);
489+
#endif
475490
newFd=-1;
476491
memmove((char*)&rmask, (char*)&basemask,sizeof(fd_set));
477492
if ((nSelected=select(nSockets,&rmask,
@@ -490,8 +505,11 @@ ServerLoop(void)
490505
* manipulate the BackEnd list, and reaper() calls free() which is
491506
* usually non-reentrant.)
492507
*/
508+
#ifdefHAVE_SIGPROCMASK
493509
sigprocmask(SIG_BLOCK,&newsigmask,&oldsigmask);
494-
/* sigblock(sigmask(SIGCHLD)); *//* XXX[TRH] portability */
510+
#else
511+
sigblock(sigmask(SIGCHLD));/* XXX[TRH] portability */
512+
#endif
495513
if (DebugLvl>1) {
496514
fprintf(stderr,"%s: ServerLoop: %d sockets pending\n",
497515
progname,nSelected);
@@ -816,15 +834,25 @@ pmdie(SIGNAL_ARGS)
816834
staticvoid
817835
reaper(SIGNAL_ARGS)
818836
{
837+
/* GH: replace waitpid for !HAVE_WAITPID. Does this work ? */
838+
#ifdefHAVE_WAITPID
819839
intstatus;/* backend exit status */
840+
#else
841+
unionwaitstatusp;/* backend exit status */
842+
#endif
820843
intpid;/* process id of dead backend */
821844

822845
if (DebugLvl)
823846
fprintf(stderr,"%s: reaping dead processes...\n",
824847
progname);
825848
#ifndefWIN32
849+
#ifdefHAVE_WAITPID
826850
while((pid=waitpid(-1,&status,WNOHANG))>0)
827851
CleanupProc(pid,status);
852+
#else
853+
while((pid=wait3(&statusp,WNOHANG,NULL))>0)
854+
CleanupProc(pid,statusp.w_status);
855+
#endif
828856
#endif/* WIN32 */
829857
}
830858

‎src/bin/pg_dump/common.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/bin/pg_dump/common.c,v 1.9 1996/11/26 07:38:18 bryanh Exp $
10+
* $Header: /cvsroot/pgsql/src/bin/pg_dump/common.c,v 1.10 1997/02/13 08:31:17 scrappy Exp $
1111
*
1212
* Modifications - 6/12/96 - dave@bensoft.com - version 1.13.dhb.2
1313
*
@@ -29,7 +29,7 @@
2929

3030
#include"postgres.h"
3131
#include"libpq-fe.h"
32-
#ifdefNEED_STRDUP
32+
#ifndefHAVE_STRDUP
3333
#include"strdup.h"
3434
#endif
3535

‎src/bin/pg_dump/pg_dump.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
*
2121
*
2222
* IDENTIFICATION
23-
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.23 1997/02/09 03:00:09 scrappy Exp $
23+
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.24 1997/02/13 08:31:27 scrappy Exp $
2424
*
2525
* Modifications - 6/10/96 - dave@bensoft.com - version 1.13.dhb
2626
*
@@ -54,7 +54,7 @@
5454
#include"postgres.h"
5555
#include"access/htup.h"
5656
#include"libpq-fe.h"
57-
#ifdefNEED_STRDUP
57+
#ifndefHAVE_STRDUP
5858
#include"strdup.h"
5959
#endif
6060

‎src/bin/psql/psql.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/bin/psql/Attic/psql.c,v 1.56 1997/02/11 03:11:33 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/bin/psql/Attic/psql.c,v 1.57 1997/02/13 08:31:48 scrappy Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -26,7 +26,7 @@
2626
#include"pqsignal.h"
2727
#include"stringutils.h"
2828
#include"psqlHelp.h"
29-
#ifdefNEED_STRDUP
29+
#ifndefHAVE_STRDUP
3030
#include"strdup.h"
3131
#endif
3232

‎src/bin/psql/stringutils.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/bin/psql/stringutils.c,v 1.7 1996/11/26 07:38:36 bryanh Exp $
10+
* $Header: /cvsroot/pgsql/src/bin/psql/stringutils.c,v 1.8 1997/02/13 08:31:57 scrappy Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -16,7 +16,7 @@
1616
#include<ctype.h>
1717
#include<stdlib.h>
1818

19-
#ifdefNEED_STRDUP
19+
#ifndefHAVE_STRDUP
2020
#include"strdup.h"
2121
#endif
2222

‎src/interfaces/libpq/fe-connect.c

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-connect.c,v 1.22 1996/11/28 03:32:12 bryanh Exp $
10+
* $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-connect.c,v 1.23 1997/02/13 08:32:08 scrappy Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -30,7 +30,7 @@
3030
#include"fe-auth.h"
3131
#include"libpq-fe.h"
3232

33-
#ifdefNEED_STRDUP
33+
#ifndefHAVE_STRDUP
3434
#include"strdup.h"
3535
#endif
3636

@@ -518,6 +518,8 @@ freePGconn(PGconn *conn)
518518
staticvoid
519519
closePGconn(PGconn*conn)
520520
{
521+
/* GH: What to do for !USE_POSIX_SIGNALS ? */
522+
#if defined(USE_POSIX_SIGNALS)
521523
structsigactionignore_action;
522524
/* This is used as a constant, but not declared as such because the
523525
sigaction structure is defined differently on different systems */
@@ -534,6 +536,12 @@ closePGconn(PGconn *conn)
534536
fputs("X\0",conn->Pfout);
535537
fflush(conn->Pfout);
536538
sigaction(SIGPIPE,&oldaction,NULL);
539+
#else
540+
signal(SIGPIPE,SIG_IGN);
541+
fputs("X\0",conn->Pfout);
542+
fflush(conn->Pfout);
543+
signal(SIGPIPE,SIG_DFL);
544+
#endif
537545
if (conn->Pfout)fclose(conn->Pfout);
538546
if (conn->Pfin)fclose(conn->Pfin);
539547
if (conn->Pfdebug)fclose(conn->Pfdebug);

‎src/port/ultrix4.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
11
# defineUSE_POSIX_TIME
2-
# defineNEED_STRDUP

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp