Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 212c905

Browse files
committed
Remove fork()/exec() and only do fork(). Small cleanups.
1 parent 2d4c6ca commit 212c905

File tree

19 files changed

+172
-144
lines changed

19 files changed

+172
-144
lines changed

src/backend/bootstrap/bootstrap.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Copyright (c) 1994, Regents of the University of California
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/bootstrap/bootstrap.c,v 1.41 1998/05/19 18:05:44 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/bootstrap/bootstrap.c,v 1.42 1998/05/29 17:00:05 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -382,7 +382,7 @@ BootstrapMain(int argc, char *argv[])
382382
* initialize input fd
383383
* ----------------
384384
*/
385-
if (IsUnderPostmaster == true && portFd < 0)
385+
if (IsUnderPostmaster && portFd < 0)
386386
{
387387
fputs("backend: failed, no -P option with -postmaster opt.\n", stderr);
388388
exitpg(1);

src/backend/executor/execQual.c

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/executor/execQual.c,v 1.31 1998/04/27 04:05:35 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/executor/execQual.c,v 1.32 1998/05/29 17:00:06 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -671,7 +671,7 @@ ExecMakeFunctionResult(Node *node,
671671
bool *isNull,
672672
bool *isDone)
673673
{
674-
Datum argv[MAXFMGRARGS];
674+
Datum argV[MAXFMGRARGS];
675675
FunctionCachePtr fcache;
676676
Func *funcNode = NULL;
677677
Oper *operNode = NULL;
@@ -699,7 +699,7 @@ ExecMakeFunctionResult(Node *node,
699699
* arguments is a list of expressions to evaluate
700700
* before passing to the function manager.
701701
* We collect the results of evaluating the expressions
702-
* into a datum array (argv) and pass this array to arrayFmgr()
702+
* into a datum array (argV) and pass this array to arrayFmgr()
703703
* ----------------
704704
*/
705705
if (fcache->nargs != 0)
@@ -718,11 +718,11 @@ ExecMakeFunctionResult(Node *node,
718718
*/
719719
if ((fcache->hasSetArg) && fcache->setArg != NULL)
720720
{
721-
argv[0] = (Datum) fcache->setArg;
721+
argV[0] = (Datum) fcache->setArg;
722722
argDone = false;
723723
}
724724
else
725-
ExecEvalFuncArgs(fcache, econtext, arguments, argv, &argDone);
725+
ExecEvalFuncArgs(fcache, econtext, arguments, argV, &argDone);
726726

727727
if ((fcache->hasSetArg) && (argDone))
728728
{
@@ -745,26 +745,26 @@ ExecMakeFunctionResult(Node *node,
745745
* which defines this set. So replace the existing funcid in the
746746
* funcnode with the set's OID. Also, we want a new fcache which
747747
* points to the right function, so get that, now that we have the
748-
* right OID. Also zero out the argv, since the real set doesn't take
748+
* right OID. Also zero out the argV, since the real set doesn't take
749749
* any arguments.
750750
*/
751751
if (((Func *) node)->funcid == F_SETEVAL)
752752
{
753753
funcisset = true;
754754
if (fcache->setArg)
755755
{
756-
argv[0] = 0;
756+
argV[0] = 0;
757757

758758
((Func *) node)->funcid = (Oid) PointerGetDatum(fcache->setArg);
759759

760760
}
761761
else
762762
{
763-
((Func *) node)->funcid = (Oid) argv[0];
764-
setFcache(node, argv[0], NIL, econtext);
763+
((Func *) node)->funcid = (Oid) argV[0];
764+
setFcache(node, argV[0], NIL, econtext);
765765
fcache = ((Func *) node)->func_fcache;
766-
fcache->setArg = (char *) argv[0];
767-
argv[0] = (Datum) 0;
766+
fcache->setArg = (char *) argV[0];
767+
argV[0] = (Datum) 0;
768768
}
769769
}
770770

@@ -778,7 +778,7 @@ ExecMakeFunctionResult(Node *node,
778778
Datum result;
779779

780780
Assert(funcNode);
781-
result = postquel_function(funcNode, (char **) argv, isNull, isDone);
781+
result = postquel_function(funcNode, (char **) argV, isNull, isDone);
782782

783783
/*
784784
* finagle the situation where we are iterating through all
@@ -791,7 +791,7 @@ ExecMakeFunctionResult(Node *node,
791791
{
792792
bool argDone;
793793

794-
ExecEvalFuncArgs(fcache, econtext, arguments, argv, &argDone);
794+
ExecEvalFuncArgs(fcache, econtext, arguments, argV, &argDone);
795795

796796
if (argDone)
797797
{
@@ -801,7 +801,7 @@ ExecMakeFunctionResult(Node *node,
801801
}
802802
else
803803
result = postquel_function(funcNode,
804-
(char **) argv,
804+
(char **) argV,
805805
isNull,
806806
isDone);
807807
}
@@ -837,7 +837,7 @@ ExecMakeFunctionResult(Node *node,
837837
if (fcache->nullVect[i] == true)
838838
*isNull = true;
839839

840-
return ((Datum) fmgr_c(&fcache->func, (FmgrValues *) argv, isNull));
840+
return ((Datum) fmgr_c(&fcache->func, (FmgrValues *) argV, isNull));
841841
}
842842
}
843843

src/backend/libpq/pqcomm.c

Lines changed: 6 additions & 3 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.42 1998/05/27 18:32:01 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/libpq/pqcomm.c,v 1.43 1998/05/29 17:00:07 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -564,8 +564,8 @@ static char sock_path[MAXPGPATH + 1] = "";
564564
void
565565
StreamDoUnlink()
566566
{
567-
if (sock_path[0])
568-
unlink(sock_path);
567+
Assert(sock_path[0]);
568+
unlink(sock_path);
569569
}
570570

571571
int
@@ -628,6 +628,9 @@ StreamServerPort(char *hostName, short portName, int *fdP)
628628
return (STATUS_ERROR);
629629
}
630630

631+
if (family == AF_UNIX)
632+
on_exitpg(StreamDoUnlink, NULL);
633+
631634
listen(fd, SOMAXCONN);
632635

633636
/*

src/backend/port/dynloader/bsdi.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
#ifndef PRE_BSDI_2_1
2222
#include <dlfcn.h>
23-
#define pg_dlopen(f) dlopen(f, 1)
23+
#define pg_dlopen(f) dlopen(f, RTLD_LAZY)
2424
#define pg_dlsym dlsym
2525
#define pg_dlclose dlclose
2626
#define pg_dlerror dlerror

0 commit comments

Comments
 (0)