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

Commit df723a8

Browse files
committed
exit recursion fix from Massimo
1 parent 17d819c commit df723a8

File tree

1 file changed

+5
-4
lines changed
  • src/backend/storage/ipc

1 file changed

+5
-4
lines changed

src/backend/storage/ipc/ipc.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/storage/ipc/ipc.c,v 1.41 1999/11/06 17:01:28 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/storage/ipc/ipc.c,v 1.42 1999/11/06 19:46:57 momjian Exp $
1111
*
1212
* NOTES
1313
*
@@ -118,18 +118,19 @@ proc_exit(int code)
118118
* If proc_exit is called too many times something bad is happening, so
119119
* exit immediately. This is crafted in two if's for a reason.
120120
*/
121-
if (proc_exit_inprogress == 9)
121+
122+
if (++proc_exit_inprogress == 9)
122123
elog(ERROR, "infinite recursion in proc_exit");
123124
if (proc_exit_inprogress >= 9)
124125
goto exit;
125126

126127
/* ----------------
127-
* if proc_exit_inprocess is true, then it means that we
128+
* if proc_exit_inprocess > 1, then it means that we
128129
* are being invoked from within an on_exit() handler
129130
* and so we return immediately to avoid recursion.
130131
* ----------------
131132
*/
132-
if (proc_exit_inprogress++)
133+
if (proc_exit_inprogress > 1)
133134
return;
134135

135136
/* do our shared memory exits first */

0 commit comments

Comments
 (0)