Skip to content

Commit 3c0f3c9

Browse files
committed
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 ...
1 parent 792b0f4 commit 3c0f3c9

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/backend/postmaster/postmaster.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
*
1212
*
1313
* IDENTIFICATION
14-
* $Header: /cvsroot/pgsql/src/backend/postmaster/postmaster.c,v 1.195 2000/11/29 20:59:52 tgl Exp $
14+
* $Header: /cvsroot/pgsql/src/backend/postmaster/postmaster.c,v 1.196 2000/11/29 22:04:04 tgl Exp $
1515
*
1616
* NOTES
1717
*
@@ -679,7 +679,7 @@ pmdaemonize(int argc, char *argv[])
679679
pid_t pid;
680680

681681
pid = fork();
682-
if (pid == -1)
682+
if (pid == (pid_t) -1)
683683
{
684684
perror("Failed to fork postmaster");
685685
ExitPostmaster(1);
@@ -691,6 +691,8 @@ pmdaemonize(int argc, char *argv[])
691691
_exit(0);
692692
}
693693

694+
MyProcPid = getpid(); /* reset MyProcPid to child */
695+
694696
/* GH: If there's no setsid(), we hopefully don't need silent mode.
695697
* Until there's a better solution.
696698
*/

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy