diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2000-11-29 22:04:04 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2000-11-29 22:04:04 +0000 |
commit | 3c0f3c9a7e5678b362d6d09cf0fb5c7c85ec3714 (patch) | |
tree | d32818e34d1bfbaea2a37fb4a87ac1321c05cc41 | |
parent | 792b0f4666b6ea6346aa8d29b568e5d3fe1fcef5 (diff) | |
download | postgresql-3c0f3c9a7e5678b362d6d09cf0fb5c7c85ec3714.tar.gz postgresql-3c0f3c9a7e5678b362d6d09cf0fb5c7c85ec3714.zip |
Just noticed that with -S switch, MyProcPid is permanently wrong in
postmaster, because it isn't updated after forking away from the terminal.
Apparently it's not used anyplace in the postmaster ... but seems best
to make it show the correct PID ...
-rw-r--r-- | src/backend/postmaster/postmaster.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/backend/postmaster/postmaster.c b/src/backend/postmaster/postmaster.c index 80ff7bac3ea..618228364ce 100644 --- a/src/backend/postmaster/postmaster.c +++ b/src/backend/postmaster/postmaster.c @@ -11,7 +11,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/postmaster/postmaster.c,v 1.195 2000/11/29 20:59:52 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/postmaster/postmaster.c,v 1.196 2000/11/29 22:04:04 tgl Exp $ * * NOTES * @@ -679,7 +679,7 @@ pmdaemonize(int argc, char *argv[]) pid_t pid; pid = fork(); - if (pid == -1) + if (pid == (pid_t) -1) { perror("Failed to fork postmaster"); ExitPostmaster(1); @@ -691,6 +691,8 @@ pmdaemonize(int argc, char *argv[]) _exit(0); } + MyProcPid = getpid(); /* reset MyProcPid to child */ + /* GH: If there's no setsid(), we hopefully don't need silent mode. * Until there's a better solution. */ |