Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
a5494a2d
Commit
a5494a2d
authored
Feb 13, 1997
by
Marc G. Fournier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Various patches for nextstep by GregorHoffleit
Replaced NEED_STRDUP by !HAVE_STRDUP
parent
809ae06a
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
51 additions
and
16 deletions
+51
-16
src/backend/postmaster/postmaster.c
src/backend/postmaster/postmaster.c
+33
-5
src/bin/pg_dump/common.c
src/bin/pg_dump/common.c
+2
-2
src/bin/pg_dump/pg_dump.c
src/bin/pg_dump/pg_dump.c
+2
-2
src/bin/psql/psql.c
src/bin/psql/psql.c
+2
-2
src/bin/psql/stringutils.c
src/bin/psql/stringutils.c
+2
-2
src/interfaces/libpq/fe-connect.c
src/interfaces/libpq/fe-connect.c
+10
-2
src/port/ultrix4.h
src/port/ultrix4.h
+0
-1
No files found.
src/backend/postmaster/postmaster.c
View file @
a5494a2d
...
...
@@ -10,7 +10,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/postmaster/postmaster.c,v 1.3
8 1997/02/06 19:27:22 momjian
Exp $
* $Header: /cvsroot/pgsql/src/backend/postmaster/postmaster.c,v 1.3
9 1997/02/13 08:31:09 scrappy
Exp $
*
* NOTES
*
...
...
@@ -420,12 +420,16 @@ pmdaemonize(void)
if
(
fork
())
exit
(
0
);
/* GH: If there's no setsid(), we hopefully don't need silent mode.
* Until there's a better solution.
*/
#ifdef HAVE_SETSID
if
(
setsid
()
<
0
)
{
fprintf
(
stderr
,
"%s: "
,
progname
);
perror
(
"cannot disassociate from controlling TTY"
);
exit
(
1
);
}
#endif
i
=
open
(
NULL_DEV
,
O_RDWR
);
(
void
)
dup2
(
i
,
0
);
(
void
)
dup2
(
i
,
1
);
...
...
@@ -459,19 +463,30 @@ ServerLoop(void)
fd_set
rmask
,
basemask
;
int
nSockets
,
nSelected
,
status
,
newFd
;
Dlelem
*
next
,
*
curr
;
/* int orgsigmask = sigblock(0); */
/* GH: For !HAVE_SIGPROCMASK (NEXTSTEP), TRH implemented
* an alternative interface.
*/
#ifdef HAVE_SIGPROCMASK
sigset_t
oldsigmask
,
newsigmask
;
#else
int
orgsigmask
=
sigblock
(
0
);
#endif
nSockets
=
ServerSock
+
1
;
FD_ZERO
(
&
basemask
);
FD_SET
(
ServerSock
,
&
basemask
);
#ifdef HAVE_SIGPROCMASK
sigprocmask
(
0
,
0
,
&
oldsigmask
);
sigemptyset
(
&
newsigmask
);
sigaddset
(
&
newsigmask
,
SIGCHLD
);
#endif
for
(;;)
{
/* sigsetmask(orgsigmask); */
#ifdef HAVE_SIGPROCMASK
sigprocmask
(
SIG_SETMASK
,
&
oldsigmask
,
0
);
#else
sigsetmask
(
orgsigmask
);
#endif
newFd
=
-
1
;
memmove
((
char
*
)
&
rmask
,
(
char
*
)
&
basemask
,
sizeof
(
fd_set
));
if
((
nSelected
=
select
(
nSockets
,
&
rmask
,
...
...
@@ -490,8 +505,11 @@ ServerLoop(void)
* manipulate the BackEnd list, and reaper() calls free() which is
* usually non-reentrant.)
*/
#ifdef HAVE_SIGPROCMASK
sigprocmask
(
SIG_BLOCK
,
&
newsigmask
,
&
oldsigmask
);
/* sigblock(sigmask(SIGCHLD)); */
/* XXX[TRH] portability */
#else
sigblock
(
sigmask
(
SIGCHLD
));
/* XXX[TRH] portability */
#endif
if
(
DebugLvl
>
1
)
{
fprintf
(
stderr
,
"%s: ServerLoop: %d sockets pending
\n
"
,
progname
,
nSelected
);
...
...
@@ -816,15 +834,25 @@ pmdie(SIGNAL_ARGS)
static
void
reaper
(
SIGNAL_ARGS
)
{
/* GH: replace waitpid for !HAVE_WAITPID. Does this work ? */
#ifdef HAVE_WAITPID
int
status
;
/* backend exit status */
#else
union
wait
statusp
;
/* backend exit status */
#endif
int
pid
;
/* process id of dead backend */
if
(
DebugLvl
)
fprintf
(
stderr
,
"%s: reaping dead processes...
\n
"
,
progname
);
#ifndef WIN32
#ifdef HAVE_WAITPID
while
((
pid
=
waitpid
(
-
1
,
&
status
,
WNOHANG
))
>
0
)
CleanupProc
(
pid
,
status
);
#else
while
((
pid
=
wait3
(
&
statusp
,
WNOHANG
,
NULL
))
>
0
)
CleanupProc
(
pid
,
statusp
.
w_status
);
#endif
#endif
/* WIN32 */
}
...
...
src/bin/pg_dump/common.c
View file @
a5494a2d
...
...
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/bin/pg_dump/common.c,v 1.
9 1996/11/26 07:38:18 bryanh
Exp $
* $Header: /cvsroot/pgsql/src/bin/pg_dump/common.c,v 1.
10 1997/02/13 08:31:17 scrappy
Exp $
*
* Modifications - 6/12/96 - dave@bensoft.com - version 1.13.dhb.2
*
...
...
@@ -29,7 +29,7 @@
#include "postgres.h"
#include "libpq-fe.h"
#if
def NEED
_STRDUP
#if
ndef HAVE
_STRDUP
#include "strdup.h"
#endif
...
...
src/bin/pg_dump/pg_dump.c
View file @
a5494a2d
...
...
@@ -20,7 +20,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.2
3 1997/02/09 03:00:09
scrappy Exp $
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.2
4 1997/02/13 08:31:27
scrappy Exp $
*
* Modifications - 6/10/96 - dave@bensoft.com - version 1.13.dhb
*
...
...
@@ -54,7 +54,7 @@
#include "postgres.h"
#include "access/htup.h"
#include "libpq-fe.h"
#if
def NEED
_STRDUP
#if
ndef HAVE
_STRDUP
#include "strdup.h"
#endif
...
...
src/bin/psql/psql.c
View file @
a5494a2d
...
...
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/bin/psql/Attic/psql.c,v 1.5
6 1997/02/11 03:11:33 momjian
Exp $
* $Header: /cvsroot/pgsql/src/bin/psql/Attic/psql.c,v 1.5
7 1997/02/13 08:31:48 scrappy
Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -26,7 +26,7 @@
#include "pqsignal.h"
#include "stringutils.h"
#include "psqlHelp.h"
#if
def NEED
_STRDUP
#if
ndef HAVE
_STRDUP
#include "strdup.h"
#endif
...
...
src/bin/psql/stringutils.c
View file @
a5494a2d
...
...
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/bin/psql/stringutils.c,v 1.
7 1996/11/26 07:38:36 bryanh
Exp $
* $Header: /cvsroot/pgsql/src/bin/psql/stringutils.c,v 1.
8 1997/02/13 08:31:57 scrappy
Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -16,7 +16,7 @@
#include <ctype.h>
#include <stdlib.h>
#if
def NEED
_STRDUP
#if
ndef HAVE
_STRDUP
#include "strdup.h"
#endif
...
...
src/interfaces/libpq/fe-connect.c
View file @
a5494a2d
...
...
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-connect.c,v 1.2
2 1996/11/28 03:32:12 bryanh
Exp $
* $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-connect.c,v 1.2
3 1997/02/13 08:32:08 scrappy
Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -30,7 +30,7 @@
#include "fe-auth.h"
#include "libpq-fe.h"
#if
def NEED
_STRDUP
#if
ndef HAVE
_STRDUP
#include "strdup.h"
#endif
...
...
@@ -518,6 +518,8 @@ freePGconn(PGconn *conn)
static
void
closePGconn
(
PGconn
*
conn
)
{
/* GH: What to do for !USE_POSIX_SIGNALS ? */
#if defined(USE_POSIX_SIGNALS)
struct
sigaction
ignore_action
;
/* This is used as a constant, but not declared as such because the
sigaction structure is defined differently on different systems */
...
...
@@ -534,6 +536,12 @@ closePGconn(PGconn *conn)
fputs
(
"X
\0
"
,
conn
->
Pfout
);
fflush
(
conn
->
Pfout
);
sigaction
(
SIGPIPE
,
&
oldaction
,
NULL
);
#else
signal
(
SIGPIPE
,
SIG_IGN
);
fputs
(
"X
\0
"
,
conn
->
Pfout
);
fflush
(
conn
->
Pfout
);
signal
(
SIGPIPE
,
SIG_DFL
);
#endif
if
(
conn
->
Pfout
)
fclose
(
conn
->
Pfout
);
if
(
conn
->
Pfin
)
fclose
(
conn
->
Pfin
);
if
(
conn
->
Pfdebug
)
fclose
(
conn
->
Pfdebug
);
...
...
src/port/ultrix4.h
View file @
a5494a2d
# define USE_POSIX_TIME
# define NEED_STRDUP
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment