Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Gpdb
提交
212c905e
G
Gpdb
项目概览
Greenplum
/
Gpdb
通知
7
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
Gpdb
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
212c905e
编写于
5月 29, 1998
作者:
B
Bruce Momjian
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Remove fork()/exec() and only do fork(). Small cleanups.
上级
2d4c6cab
变更
19
隐藏空白更改
内联
并排
Showing
19 changed file
with
172 addition
and
144 deletion
+172
-144
src/backend/bootstrap/bootstrap.c
src/backend/bootstrap/bootstrap.c
+2
-2
src/backend/executor/execQual.c
src/backend/executor/execQual.c
+15
-15
src/backend/libpq/pqcomm.c
src/backend/libpq/pqcomm.c
+6
-3
src/backend/port/dynloader/bsdi.h
src/backend/port/dynloader/bsdi.h
+1
-1
src/backend/postmaster/postmaster.c
src/backend/postmaster/postmaster.c
+93
-53
src/backend/storage/ipc/ipc.c
src/backend/storage/ipc/ipc.c
+17
-4
src/backend/storage/ipc/ipci.c
src/backend/storage/ipc/ipci.c
+2
-2
src/backend/storage/smgr/mm.c
src/backend/storage/smgr/mm.c
+2
-3
src/backend/storage/smgr/smgr.c
src/backend/storage/smgr/smgr.c
+2
-2
src/backend/tcop/postgres.c
src/backend/tcop/postgres.c
+9
-29
src/backend/utils/error/excabort.c
src/backend/utils/error/excabort.c
+1
-5
src/backend/utils/init/globals.c
src/backend/utils/init/globals.c
+1
-2
src/backend/utils/init/miscinit.c
src/backend/utils/init/miscinit.c
+1
-8
src/backend/utils/init/postinit.c
src/backend/utils/init/postinit.c
+6
-3
src/include/libpq/libpq.h
src/include/libpq/libpq.h
+4
-4
src/include/miscadmin.h
src/include/miscadmin.h
+1
-2
src/include/storage/ipc.h
src/include/storage/ipc.h
+3
-2
src/include/tcop/tcopprot.h
src/include/tcop/tcopprot.h
+4
-2
src/interfaces/Makefile
src/interfaces/Makefile
+2
-2
未找到文件。
src/backend/bootstrap/bootstrap.c
浏览文件 @
212c905e
...
...
@@ -7,7 +7,7 @@
* Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/bootstrap/bootstrap.c,v 1.4
1 1998/05/19 18:05:44
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/bootstrap/bootstrap.c,v 1.4
2 1998/05/29 17:00:05
momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -382,7 +382,7 @@ BootstrapMain(int argc, char *argv[])
* initialize input fd
* ----------------
*/
if
(
IsUnderPostmaster
==
true
&&
portFd
<
0
)
if
(
IsUnderPostmaster
&&
portFd
<
0
)
{
fputs
(
"backend: failed, no -P option with -postmaster opt.
\n
"
,
stderr
);
exitpg
(
1
);
...
...
src/backend/executor/execQual.c
浏览文件 @
212c905e
...
...
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/executor/execQual.c,v 1.3
1 1998/04/27 04:05:35
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/executor/execQual.c,v 1.3
2 1998/05/29 17:00:06
momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -671,7 +671,7 @@ ExecMakeFunctionResult(Node *node,
bool
*
isNull
,
bool
*
isDone
)
{
Datum
arg
v
[
MAXFMGRARGS
];
Datum
arg
V
[
MAXFMGRARGS
];
FunctionCachePtr
fcache
;
Func
*
funcNode
=
NULL
;
Oper
*
operNode
=
NULL
;
...
...
@@ -699,7 +699,7 @@ ExecMakeFunctionResult(Node *node,
* arguments is a list of expressions to evaluate
* before passing to the function manager.
* We collect the results of evaluating the expressions
* into a datum array (arg
v
) and pass this array to arrayFmgr()
* into a datum array (arg
V
) and pass this array to arrayFmgr()
* ----------------
*/
if
(
fcache
->
nargs
!=
0
)
...
...
@@ -718,11 +718,11 @@ ExecMakeFunctionResult(Node *node,
*/
if
((
fcache
->
hasSetArg
)
&&
fcache
->
setArg
!=
NULL
)
{
arg
v
[
0
]
=
(
Datum
)
fcache
->
setArg
;
arg
V
[
0
]
=
(
Datum
)
fcache
->
setArg
;
argDone
=
false
;
}
else
ExecEvalFuncArgs
(
fcache
,
econtext
,
arguments
,
arg
v
,
&
argDone
);
ExecEvalFuncArgs
(
fcache
,
econtext
,
arguments
,
arg
V
,
&
argDone
);
if
((
fcache
->
hasSetArg
)
&&
(
argDone
))
{
...
...
@@ -745,7 +745,7 @@ ExecMakeFunctionResult(Node *node,
* which defines this set. So replace the existing funcid in the
* funcnode with the set's OID. Also, we want a new fcache which
* points to the right function, so get that, now that we have the
* right OID. Also zero out the arg
v
, since the real set doesn't take
* right OID. Also zero out the arg
V
, since the real set doesn't take
* any arguments.
*/
if
(((
Func
*
)
node
)
->
funcid
==
F_SETEVAL
)
...
...
@@ -753,18 +753,18 @@ ExecMakeFunctionResult(Node *node,
funcisset
=
true
;
if
(
fcache
->
setArg
)
{
arg
v
[
0
]
=
0
;
arg
V
[
0
]
=
0
;
((
Func
*
)
node
)
->
funcid
=
(
Oid
)
PointerGetDatum
(
fcache
->
setArg
);
}
else
{
((
Func
*
)
node
)
->
funcid
=
(
Oid
)
arg
v
[
0
];
setFcache
(
node
,
arg
v
[
0
],
NIL
,
econtext
);
((
Func
*
)
node
)
->
funcid
=
(
Oid
)
arg
V
[
0
];
setFcache
(
node
,
arg
V
[
0
],
NIL
,
econtext
);
fcache
=
((
Func
*
)
node
)
->
func_fcache
;
fcache
->
setArg
=
(
char
*
)
arg
v
[
0
];
arg
v
[
0
]
=
(
Datum
)
0
;
fcache
->
setArg
=
(
char
*
)
arg
V
[
0
];
arg
V
[
0
]
=
(
Datum
)
0
;
}
}
...
...
@@ -778,7 +778,7 @@ ExecMakeFunctionResult(Node *node,
Datum
result
;
Assert
(
funcNode
);
result
=
postquel_function
(
funcNode
,
(
char
**
)
arg
v
,
isNull
,
isDone
);
result
=
postquel_function
(
funcNode
,
(
char
**
)
arg
V
,
isNull
,
isDone
);
/*
* finagle the situation where we are iterating through all
...
...
@@ -791,7 +791,7 @@ ExecMakeFunctionResult(Node *node,
{
bool
argDone
;
ExecEvalFuncArgs
(
fcache
,
econtext
,
arguments
,
arg
v
,
&
argDone
);
ExecEvalFuncArgs
(
fcache
,
econtext
,
arguments
,
arg
V
,
&
argDone
);
if
(
argDone
)
{
...
...
@@ -801,7 +801,7 @@ ExecMakeFunctionResult(Node *node,
}
else
result
=
postquel_function
(
funcNode
,
(
char
**
)
arg
v
,
(
char
**
)
arg
V
,
isNull
,
isDone
);
}
...
...
@@ -837,7 +837,7 @@ ExecMakeFunctionResult(Node *node,
if
(
fcache
->
nullVect
[
i
]
==
true
)
*
isNull
=
true
;
return
((
Datum
)
fmgr_c
(
&
fcache
->
func
,
(
FmgrValues
*
)
arg
v
,
isNull
));
return
((
Datum
)
fmgr_c
(
&
fcache
->
func
,
(
FmgrValues
*
)
arg
V
,
isNull
));
}
}
...
...
src/backend/libpq/pqcomm.c
浏览文件 @
212c905e
...
...
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/libpq/pqcomm.c,v 1.4
2 1998/05/27 18:32:01
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/libpq/pqcomm.c,v 1.4
3 1998/05/29 17:00:07
momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -564,8 +564,8 @@ static char sock_path[MAXPGPATH + 1] = "";
void
StreamDoUnlink
()
{
if
(
sock_path
[
0
])
unlink
(
sock_path
);
Assert
(
sock_path
[
0
]);
unlink
(
sock_path
);
}
int
...
...
@@ -628,6 +628,9 @@ StreamServerPort(char *hostName, short portName, int *fdP)
return
(
STATUS_ERROR
);
}
if
(
family
==
AF_UNIX
)
on_exitpg
(
StreamDoUnlink
,
NULL
);
listen
(
fd
,
SOMAXCONN
);
/*
...
...
src/backend/port/dynloader/bsdi.h
浏览文件 @
212c905e
...
...
@@ -20,7 +20,7 @@
#ifndef PRE_BSDI_2_1
#include <dlfcn.h>
#define pg_dlopen(f) dlopen(f,
1
)
#define pg_dlopen(f) dlopen(f,
RTLD_LAZY
)
#define pg_dlsym dlsym
#define pg_dlclose dlclose
#define pg_dlerror dlerror
...
...
src/backend/postmaster/postmaster.c
浏览文件 @
212c905e
...
...
@@ -10,7 +10,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/postmaster/postmaster.c,v 1.7
7 1998/05/27 18:32:02
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/postmaster/postmaster.c,v 1.7
8 1998/05/29 17:00:09
momjian Exp $
*
* NOTES
*
...
...
@@ -82,6 +82,8 @@
#include "miscadmin.h"
#include "version.h"
#include "lib/dllist.h"
#include "tcop/tcopprot.h"
#include "commands/async.h"
#include "nodes/nodes.h"
#include "utils/mcxt.h"
#include "storage/proc.h"
...
...
@@ -91,16 +93,6 @@
#endif
#include "storage/fd.h"
#if defined(DBX_VERSION)
#define FORK() (0)
#else
#ifndef HAVE_VFORK
#define FORK() fork()
#else
#define FORK() vfork()
#endif
#endif
#if !defined(MAXINT)
#define MAXINT INT_MAX
#endif
...
...
@@ -165,6 +157,7 @@ static IpcMemoryKey ipc_key;
static
int
NextBackendId
=
MAXINT
;
/* XXX why? */
static
char
*
progname
=
(
char
*
)
NULL
;
static
char
**
argv_name
;
/*
* Default Values
...
...
@@ -192,6 +185,19 @@ static int SendStop = false;
static
bool
NetServer
=
false
;
/* if not zero, postmaster listen for
* non-local connections */
/*
* GH: For !HAVE_SIGPROCMASK (NEXTSTEP), TRH implemented an
* alternative interface.
*/
#ifdef HAVE_SIGPROCMASK
static
sigset_t
oldsigmask
,
newsigmask
;
#else
static
int
orgsigmask
=
sigblock
(
0
);
#endif
/*
* postmaster.c - function prototypes
*/
...
...
@@ -202,7 +208,7 @@ static void pmdie(SIGNAL_ARGS);
static
void
reaper
(
SIGNAL_ARGS
);
static
void
dumpstatus
(
SIGNAL_ARGS
);
static
void
CleanupProc
(
int
pid
,
int
exitstatus
);
static
int
Do
Exec
(
Port
*
port
);
static
int
Do
Backend
(
Port
*
port
);
static
void
ExitPostmaster
(
int
status
);
static
void
usage
(
const
char
*
);
static
int
ServerLoop
(
void
);
...
...
@@ -284,7 +290,6 @@ int
PostmasterMain
(
int
argc
,
char
*
argv
[])
{
extern
int
NBuffers
;
/* from buffer/bufmgr.c */
extern
bool
IsPostmaster
;
/* from smgr/mm.c */
int
opt
;
char
*
hostName
;
int
status
;
...
...
@@ -293,9 +298,8 @@ PostmasterMain(int argc, char *argv[])
char
hostbuf
[
MAXHOSTNAMELEN
];
progname
=
argv
[
0
];
IsPostmaster
=
true
;
argv_name
=
&
argv
[
0
];
/*
* for security, no dir or file created can be group or other
* accessible
...
...
@@ -531,26 +535,14 @@ ServerLoop(void)
int
nSockets
;
Dlelem
*
curr
;
/*
* GH: For !HAVE_SIGPROCMASK (NEXTSTEP), TRH implemented an
* alternative interface.
*/
#ifdef HAVE_SIGPROCMASK
sigset_t
oldsigmask
,
newsigmask
;
#else
int
orgsigmask
=
sigblock
(
0
);
#endif
nSockets
=
initMasks
(
&
readmask
,
&
writemask
);
#ifdef HAVE_SIGPROCMASK
sigprocmask
(
0
,
0
,
&
oldsigmask
);
sigprocmask
(
0
,
NULL
,
&
oldsigmask
);
sigemptyset
(
&
newsigmask
);
sigaddset
(
&
newsigmask
,
SIGCHLD
);
#endif
for
(;;)
{
Port
*
port
;
...
...
@@ -1048,13 +1040,17 @@ BackendStartup(Port *port)
fprintf
(
stderr
,
"-----------------------------------------
\n
"
);
}
if
((
pid
=
FORK
())
==
0
)
{
/* child */
if
(
DoExec
(
port
))
fprintf
(
stderr
,
"%s child[%d]: BackendStartup: execv failed
\n
"
,
progname
,
pid
);
/* use _exit to keep from double-flushing stdio */
_exit
(
1
);
if
((
pid
=
fork
())
==
0
)
{
/* child */
if
(
DoBackend
(
port
))
{
fprintf
(
stderr
,
"%s child[%d]: BackendStartup: backend startup failed
\n
"
,
progname
,
pid
);
/* use _exit to keep from double-flushing stdio */
_exit
(
1
);
}
else
_exit
(
0
);
}
/* in parent */
...
...
@@ -1123,19 +1119,14 @@ split_opts(char **argv, int *argcp, char *s)
}
/*
* DoExec -- set up the argument list and perform an execv system call
*
* Tries fairly hard not to dork with anything that isn't automatically
* allocated so we don't do anything weird to the postmaster when it gets
* its thread back. (This is vfork() we're talking about. If we're using
* fork() because we don't have vfork(), then we don't really care.)
* DoBackend -- set up the argument list and perform an execv system call
*
* returns:
*
Shouldn't return at all.
*
If execv() fails, return status.
* returns:
*
Shouldn't return at all.
*
If execv() fails, return status.
*/
static
int
Do
Exec
(
Port
*
port
)
Do
Backend
(
Port
*
port
)
{
char
execbuf
[
MAXPATHLEN
];
char
portbuf
[
ARGV_SIZE
];
...
...
@@ -1154,9 +1145,58 @@ DoExec(Port *port)
int
ac
=
0
;
int
i
;
/*
* Let's clean up ourselves as the postmaster child
*/
clear_exitpg
();
/* we don't want the postmaster's exitpg() handlers */
/* ----------------
* register signal handlers.
* Thanks to the postmaster, these are currently blocked.
* ----------------
*/
pqsignal
(
SIGINT
,
die
);
pqsignal
(
SIGHUP
,
die
);
pqsignal
(
SIGTERM
,
die
);
pqsignal
(
SIGPIPE
,
die
);
pqsignal
(
SIGUSR1
,
quickdie
);
pqsignal
(
SIGUSR2
,
Async_NotifyHandler
);
pqsignal
(
SIGFPE
,
FloatExceptionHandler
);
pqsignal
(
SIGCHLD
,
SIG_DFL
);
pqsignal
(
SIGTTIN
,
SIG_DFL
);
pqsignal
(
SIGTTOU
,
SIG_DFL
);
pqsignal
(
SIGCONT
,
SIG_DFL
);
/* OK, let's unblock our signals, all together now... */
sigprocmask
(
SIG_SETMASK
,
&
oldsigmask
,
0
);
/* Close the postmater sockets */
if
(
NetServer
)
StreamClose
(
ServerSock_INET
);
StreamClose
(
ServerSock_UNIX
);
/* Now, on to standard postgres stuff */
MyProcPid
=
getpid
();
strncpy
(
execbuf
,
Execfile
,
MAXPATHLEN
-
1
);
av
[
ac
++
]
=
execbuf
;
/*
* We need to set our argv[0] to an absolute path name because
* some OS's use this for dynamic loading, like BSDI. Without it,
* when we change directories to the database dir, the dynamic
* loader can't find the base executable and fails.
* Another advantage is that this changes the 'ps' displayed
* process name on some platforms. It does on BSDI. That's
* a big win.
*/
*
argv_name
=
Execfile
;
/* Tell the backend it is being called from the postmaster */
av
[
ac
++
]
=
"-p"
;
...
...
@@ -1195,7 +1235,7 @@ DoExec(Port *port)
/* Tell the backend what protocol the frontend is using. */
sprintf
(
protobuf
,
"-v
%u"
,
port
->
proto
);
sprintf
(
protobuf
,
"-v%u"
,
port
->
proto
);
av
[
ac
++
]
=
protobuf
;
StrNCpy
(
dbbuf
,
port
->
database
,
ARGV_SIZE
);
...
...
@@ -1205,14 +1245,14 @@ DoExec(Port *port)
if
(
DebugLvl
>
1
)
{
fprintf
(
stderr
,
"%s child[%
ld]: execv
("
,
progname
,
(
long
)
MyProcPid
);
fprintf
(
stderr
,
"%s child[%
d]: starting with
("
,
progname
,
MyProcPid
);
for
(
i
=
0
;
i
<
ac
;
++
i
)
fprintf
(
stderr
,
"%s, "
,
av
[
i
]);
fprintf
(
stderr
,
")
\n
"
);
}
return
(
execv
(
av
[
0
]
,
av
));
return
(
PostgresMain
(
ac
,
av
));
}
/*
...
...
@@ -1228,9 +1268,9 @@ ExitPostmaster(int status)
* the backends all be killed? probably not.
*/
if
(
ServerSock_INET
!=
INVALID_SOCK
)
c
lose
(
ServerSock_INET
);
StreamC
lose
(
ServerSock_INET
);
if
(
ServerSock_UNIX
!=
INVALID_SOCK
)
c
lose
(
ServerSock_UNIX
);
StreamC
lose
(
ServerSock_UNIX
);
exitpg
(
status
);
}
...
...
src/backend/storage/ipc/ipc.c
浏览文件 @
212c905e
...
...
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/storage/ipc/ipc.c,v 1.2
0 1998/03/02 05:41:55 scrappy
Exp $
* $Header: /cvsroot/pgsql/src/backend/storage/ipc/ipc.c,v 1.2
1 1998/05/29 17:00:10 momjian
Exp $
*
* NOTES
*
...
...
@@ -137,7 +137,6 @@ exitpg(int code)
for
(
i
=
onexit_index
-
1
;
i
>=
0
;
--
i
)
(
*
onexit_list
[
i
].
function
)
(
code
,
onexit_list
[
i
].
arg
);
StreamDoUnlink
();
exit
(
code
);
}
...
...
@@ -168,7 +167,9 @@ quasi_exitpg()
* ----------------
*/
for
(
i
=
onexit_index
-
1
;
i
>=
0
;
--
i
)
(
*
onexit_list
[
i
].
function
)
(
0
,
onexit_list
[
i
].
arg
);
/* Don't do StreamDoUnlink on quasi_exit */
if
(
onexit_list
[
i
].
function
!=
StreamDoUnlink
)
(
*
onexit_list
[
i
].
function
)
(
0
,
onexit_list
[
i
].
arg
);
onexit_index
=
0
;
exitpg_inprogress
=
0
;
...
...
@@ -182,7 +183,7 @@ quasi_exitpg()
* ----------------------------------------------------------------
*/
int
on_exitpg
(
void
(
*
function
)
(),
caddr_t
arg
)
on_exitpg
(
void
(
*
function
)
(),
caddr_t
arg
)
{
if
(
onexit_index
>=
MAX_ON_EXITS
)
return
(
-
1
);
...
...
@@ -195,6 +196,18 @@ int
return
(
0
);
}
/* ----------------------------------------------------------------
* clear_exitpg
*
* this function clears all exitpg() registered functions.
* ----------------------------------------------------------------
*/
void
clear_exitpg
(
void
)
{
onexit_index
=
0
;
}
/****************************************************************************/
/* IPCPrivateSemaphoreKill(status, semId) */
/* */
...
...
src/backend/storage/ipc/ipci.c
浏览文件 @
212c905e
...
...
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/storage/ipc/ipci.c,v 1.
7 1997/09/08 02:28:48
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/storage/ipc/ipci.c,v 1.
8 1998/05/29 17:00:12
momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -101,7 +101,7 @@ CreateSharedMemoryAndSemaphores(IPCKey key)
* ----------------
*/
InitProcGlobal
(
key
);
on_exitpg
(
ProcFreeAllSemaphores
,
0
);
on_exitpg
(
ProcFreeAllSemaphores
,
NULL
);
CreateSharedInvalidationState
(
key
);
}
...
...
src/backend/storage/smgr/mm.c
浏览文件 @
212c905e
...
...
@@ -10,7 +10,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/storage/smgr/Attic/mm.c,v 1.
7 1997/09/18 20:21:5
3 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/storage/smgr/Attic/mm.c,v 1.
8 1998/05/29 17:00:1
3 momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -79,7 +79,6 @@ typedef struct MMRelHashEntry
#define MMNRELATIONS 2
SPINLOCK
MMCacheLock
;
extern
bool
IsPostmaster
;
extern
Oid
MyDatabaseId
;
static
int
*
MMCurTop
;
...
...
@@ -139,7 +138,7 @@ mminit()
return
(
SM_FAIL
);
}
if
(
Is
Postmaster
)
if
(
Is
UnderPostmaster
)
/* was IsPostmaster bjm */
{
MemSet
(
mmcacheblk
,
0
,
mmsize
);
SpinRelease
(
MMCacheLock
);
...
...
src/backend/storage/smgr/smgr.c
浏览文件 @
212c905e
...
...
@@ -10,7 +10,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/storage/smgr/smgr.c,v 1.1
4 1998/04/01 15:35:33 scrappy
Exp $
* $Header: /cvsroot/pgsql/src/backend/storage/smgr/smgr.c,v 1.1
5 1998/05/29 17:00:14 momjian
Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -100,7 +100,7 @@ smgrinit()
}
/* register the shutdown proc */
on_exitpg
(
smgrshutdown
,
0
);
on_exitpg
(
smgrshutdown
,
NULL
);
return
(
SM_SUCCESS
);
}
...
...
src/backend/tcop/postgres.c
浏览文件 @
212c905e
...
...
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.7
1 1998/05/27 18:32:03
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.7
2 1998/05/29 17:00:15
momjian Exp $
*
* NOTES
* this is the "main" module of the postgres backend and
...
...
@@ -83,8 +83,6 @@
#include "nodes/memnodes.h"
#endif
static
void
quickdie
(
SIGNAL_ARGS
);
/* ----------------
* global variables
* ----------------
...
...
@@ -743,7 +741,7 @@ handle_warn(SIGNAL_ARGS)
siglongjmp
(
Warn_restart
,
1
);
}
static
void
void
quickdie
(
SIGNAL_ARGS
)
{
elog
(
NOTICE
,
"Message from PostgreSQL backend:"
...
...
@@ -770,7 +768,7 @@ die(SIGNAL_ARGS)
}
/* signal handler for floating point exception */
static
void
void
FloatExceptionHandler
(
SIGNAL_ARGS
)
{
elog
(
ERROR
,
"floating point exception!"
...
...
@@ -849,26 +847,6 @@ PostgresMain(int argc, char *argv[])
extern
char
*
optarg
;
extern
short
DebugLvl
;
/* ----------------
* register signal handlers.
* ----------------
*/
pqsignal
(
SIGINT
,
die
);
pqsignal
(
SIGHUP
,
die
);
pqsignal
(
SIGTERM
,
die
);
pqsignal
(
SIGPIPE
,
die
);
pqsignal
(
SIGUSR1
,
quickdie
);
pqsignal
(
SIGUSR2
,
Async_NotifyHandler
);
pqsignal
(
SIGFPE
,
FloatExceptionHandler
);
/* --------------------
* initialize globals
* -------------------
*/
MyProcPid
=
getpid
();
/* ----------------
* parse command line arguments
* ----------------
...
...
@@ -915,6 +893,8 @@ PostgresMain(int argc, char *argv[])
EuroDates
=
TRUE
;
}
optind
=
1
;
/* reset after postmaster usage */
while
((
flag
=
getopt
(
argc
,
argv
,
"B:bCD:d:Eef:iK:Lm:MNo:P:pQS:st:v:x:F"
))
!=
EOF
)
switch
(
flag
)
...
...
@@ -1254,7 +1234,7 @@ PostgresMain(int argc, char *argv[])
* initialize portal file descriptors
* ----------------
*/
if
(
IsUnderPostmaster
==
true
)
if
(
IsUnderPostmaster
)
{
if
(
Portfd
<
0
)
{
...
...
@@ -1314,10 +1294,10 @@ PostgresMain(int argc, char *argv[])
* POSTGRES main processing loop begins here
* ----------------
*/
if
(
IsUnderPostmaster
==
false
)
if
(
!
IsUnderPostmaster
)
{
puts
(
"
\n
POSTGRES backend interactive interface"
);
puts
(
"$Revision: 1.7
1 $ $Date: 1998/05/27 18:32:03
$"
);
puts
(
"$Revision: 1.7
2 $ $Date: 1998/05/29 17:00:15
$"
);
}
/* ----------------
...
...
@@ -1327,7 +1307,7 @@ PostgresMain(int argc, char *argv[])
* ----------------
*/
if
(
!
TransactionFlushEnabled
())
on_exitpg
(
FlushBufferPool
,
(
caddr_t
)
0
);
on_exitpg
(
FlushBufferPool
,
NULL
);
for
(;;)
{
...
...
src/backend/utils/error/excabort.c
浏览文件 @
212c905e
...
...
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/error/Attic/excabort.c,v 1.
4 1997/09/08 21:49:03
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/error/Attic/excabort.c,v 1.
5 1998/05/29 17:00:16
momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -22,10 +22,6 @@ ExcAbort(const Exception *excP,
ExcData
data
,
ExcMessage
message
)
{
#ifdef __SABER__
saber_stop
();
#else
/* dump core */
abort
();
#endif
}
src/backend/utils/init/globals.c
浏览文件 @
212c905e
...
...
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/init/globals.c,v 1.2
2 1998/05/19 18:05:51
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/init/globals.c,v 1.2
3 1998/05/29 17:00:18
momjian Exp $
*
* NOTES
* Globals used all over the place should be declared here and not
...
...
@@ -66,7 +66,6 @@ Oid MyDatabaseId = InvalidOid;
bool
TransactionInitWasProcessed
=
false
;
bool
IsUnderPostmaster
=
false
;
bool
IsPostmaster
=
false
;
short
DebugLvl
=
0
;
...
...
src/backend/utils/init/miscinit.c
浏览文件 @
212c905e
...
...
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/init/miscinit.c,v 1.1
4 1998/04/05 21:04:36
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/init/miscinit.c,v 1.1
5 1998/05/29 17:00:19
momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -84,9 +84,6 @@ unsigned char RecodeBackTable[128];
void
ExitPostgres
(
ExitStatus
status
)
{
#ifdef __SABER__
saber_stop
();
#endif
exitpg
(
status
);
}
...
...
@@ -111,10 +108,6 @@ AbortPostgres()
{
char
*
abortValue
=
getenv
(
EnableAbortEnvVarName
);
#ifdef __SABER__
saber_stop
();
#endif
if
(
PointerIsValid
(
abortValue
)
&&
abortValue
[
0
]
!=
'\0'
)
abort
();
else
...
...
src/backend/utils/init/postinit.c
浏览文件 @
212c905e
...
...
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/init/postinit.c,v 1.2
7 1998/04/05 21:04:43
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/init/postinit.c,v 1.2
8 1998/05/29 17:00:21
momjian Exp $
*
* NOTES
* InitPostgres() is the function called from PostgresMain
...
...
@@ -384,8 +384,11 @@ forcesharedmemory:
#endif
PostgresIpcKey
=
key
;
AttachSharedMemoryAndSemaphores
(
key
);
if
(
!
IsUnderPostmaster
)
/* postmaster already did this */
{
PostgresIpcKey
=
key
;
AttachSharedMemoryAndSemaphores
(
key
);
}
}
...
...
src/include/libpq/libpq.h
浏览文件 @
212c905e
...
...
@@ -6,7 +6,7 @@
*
* Copyright (c) 1994, Regents of the University of California
*
* $Id: libpq.h,v 1.1
4 1998/05/19 18:05:55
momjian Exp $
* $Id: libpq.h,v 1.1
5 1998/05/29 17:00:24
momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -279,9 +279,9 @@ extern int StreamOpen(char *hostName, short portName, Port *port);
extern
void
pq_regoob
(
void
(
*
fptr
)
());
extern
void
pq_unregoob
(
void
);
extern
void
pq_async_notify
(
void
);
extern
int
StreamServerPort
(
char
*
hostName
,
short
portName
,
int
*
fdP
);
extern
int
StreamConnection
(
int
server_fd
,
Port
*
port
);
extern
void
StreamDoUnlink
();
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 */
src/include/miscadmin.h
浏览文件 @
212c905e
...
...
@@ -11,7 +11,7 @@
*
* Copyright (c) 1994, Regents of the University of California
*
* $Id: miscadmin.h,v 1.2
3 1998/05/19 18:05:5
2 momjian Exp $
* $Id: miscadmin.h,v 1.2
4 1998/05/29 17:00:2
2 momjian Exp $
*
* NOTES
* some of the information in this file will be moved to
...
...
@@ -55,7 +55,6 @@ extern Oid MyDatabaseId;
extern
bool
TransactionInitWasProcessed
;
extern
bool
IsUnderPostmaster
;
extern
bool
IsPostmaster
;
extern
short
DebugLvl
;
...
...
src/include/storage/ipc.h
浏览文件 @
212c905e
...
...
@@ -6,7 +6,7 @@
*
* Copyright (c) 1994, Regents of the University of California
*
* $Id: ipc.h,v 1.2
4 1998/02/26 04:43
:26 momjian Exp $
* $Id: ipc.h,v 1.2
5 1998/05/29 17:00
:26 momjian Exp $
*
* NOTES
* This file is very architecture-specific. This stuff should actually
...
...
@@ -73,7 +73,8 @@ typedef int IpcMemoryId;
/* ipc.c */
extern
void
exitpg
(
int
code
);
extern
void
quasi_exitpg
(
void
);
extern
int
on_exitpg
(
void
(
*
function
)
(),
caddr_t
arg
);
extern
int
on_exitpg
(
void
(
*
function
)
(),
caddr_t
arg
);
extern
void
clear_exitpg
(
void
);
extern
IpcSemaphoreId
IpcSemaphoreCreate
(
IpcSemaphoreKey
semKey
,
...
...
src/include/tcop/tcopprot.h
浏览文件 @
212c905e
...
...
@@ -6,7 +6,7 @@
*
* Copyright (c) 1994, Regents of the University of California
*
* $Id: tcopprot.h,v 1.1
2 1998/05/19 18:05:5
8 momjian Exp $
* $Id: tcopprot.h,v 1.1
3 1998/05/29 17:00:2
8 momjian Exp $
*
* OLD COMMENTS
* This file was created so that other c files could get the two
...
...
@@ -33,9 +33,11 @@ pg_exec_query_dest(char *query_string, char **argv, Oid *typev,
#endif
/* BOOTSTRAP_HEADER */
extern
void
handle_warn
(
SIGNAL_ARGS
);
extern
void
quickdie
(
SIGNAL_ARGS
);
extern
void
die
(
SIGNAL_ARGS
);
extern
void
FloatExceptionHandler
(
SIGNAL_ARGS
);
extern
void
CancelQuery
(
void
);
extern
int
PostgresMain
(
int
argc
,
char
*
argv
[]);
extern
int
PostgresMain
(
int
argc
,
char
*
argv
[]);
extern
void
ResetUsage
(
void
);
extern
void
ShowUsage
(
void
);
...
...
src/interfaces/Makefile
浏览文件 @
212c905e
...
...
@@ -7,7 +7,7 @@
#
#
# IDENTIFICATION
# $Header: /cvsroot/pgsql/src/interfaces/Makefile,v 1.
9 1998/03/05 13:18:51 scrappy
Exp $
# $Header: /cvsroot/pgsql/src/interfaces/Makefile,v 1.
10 1998/05/29 17:00:29 momjian
Exp $
#
#-------------------------------------------------------------------------
...
...
@@ -16,7 +16,7 @@ include $(SRCDIR)/Makefile.global
.DEFAULT all
:
$(MAKE)
-C
libpq
$@
$(MAKE)
-C
ecpg
$@
#
$(MAKE) -C ecpg $@
ifeq
($(HAVE_Cplusplus), true)
$(MAKE)
-C
libpq++
$@
else
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录