aboutsummaryrefslogtreecommitdiff
path: root/src/backend/storage/ipc/ipc.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/storage/ipc/ipc.c')
-rw-r--r--src/backend/storage/ipc/ipc.c23
1 files changed, 2 insertions, 21 deletions
diff --git a/src/backend/storage/ipc/ipc.c b/src/backend/storage/ipc/ipc.c
index 540209ce795..1ca813a72da 100644
--- a/src/backend/storage/ipc/ipc.c
+++ b/src/backend/storage/ipc/ipc.c
@@ -39,7 +39,7 @@
bool proc_exit_inprogress = false;
/*
- * This flag tracks whether we've called atexit(2) in the current process
+ * This flag tracks whether we've called atexit() in the current process
* (or in the parent postmaster).
*/
static bool atexit_callback_setup = false;
@@ -51,7 +51,7 @@ static void proc_exit_prepare(int code);
/* ----------------------------------------------------------------
* exit() handling stuff
*
- * These functions are in generally the same spirit as atexit(2),
+ * These functions are in generally the same spirit as atexit(),
* but provide some additional features we need --- in particular,
* we want to register callbacks to invoke when we are disconnecting
* from a broken shared-memory context but not exiting the postmaster.
@@ -234,8 +234,6 @@ shmem_exit(int code)
* postmaster treat it as a crash --- see pmsignal.c.
* ----------------------------------------------------------------
*/
-#ifdef HAVE_ATEXIT
-
static void
atexit_callback(void)
{
@@ -243,15 +241,6 @@ atexit_callback(void)
/* ... too bad we don't know the real exit code ... */
proc_exit_prepare(-1);
}
-#else /* assume we have on_exit instead */
-
-static void
-atexit_callback(int exitstatus, void *arg)
-{
- /* Clean up everything that must be cleaned up */
- proc_exit_prepare(exitstatus);
-}
-#endif /* HAVE_ATEXIT */
/* ----------------------------------------------------------------
* on_proc_exit
@@ -275,11 +264,7 @@ on_proc_exit(pg_on_exit_callback function, Datum arg)
if (!atexit_callback_setup)
{
-#ifdef HAVE_ATEXIT
atexit(atexit_callback);
-#else
- on_exit(atexit_callback, NULL);
-#endif
atexit_callback_setup = true;
}
}
@@ -306,11 +291,7 @@ on_shmem_exit(pg_on_exit_callback function, Datum arg)
if (!atexit_callback_setup)
{
-#ifdef HAVE_ATEXIT
atexit(atexit_callback);
-#else
- on_exit(atexit_callback, NULL);
-#endif
atexit_callback_setup = true;
}
}