diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/backend/storage/ipc/ipc.c | 23 | ||||
-rw-r--r-- | src/bin/psql/input.c | 13 | ||||
-rw-r--r-- | src/include/pg_config.h.in | 6 | ||||
-rw-r--r-- | src/include/pg_config.h.win32 | 6 |
4 files changed, 2 insertions, 46 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; } } diff --git a/src/bin/psql/input.c b/src/bin/psql/input.c index ec0e6e1d49b..870251bb84b 100644 --- a/src/bin/psql/input.c +++ b/src/bin/psql/input.c @@ -45,12 +45,7 @@ static int history_lines_added; #define NL_IN_HISTORY 0x01 #endif -#ifdef HAVE_ATEXIT static void finishInput(void); -#else -/* designed for use with on_exit() */ -static void finishInput(int, void *); -#endif /* @@ -313,11 +308,7 @@ initializeInput(int flags) } #endif -#ifdef HAVE_ATEXIT atexit(finishInput); -#else - on_exit(finishInput, NULL); -#endif } @@ -416,11 +407,7 @@ saveHistory(char *fname, int max_lines, bool appendFlag, bool encodeFlag) static void -#ifdef HAVE_ATEXIT finishInput(void) -#else -finishInput(int exitstatus, void *arg) -#endif { #ifdef USE_READLINE if (useHistory && psql_history) diff --git a/src/include/pg_config.h.in b/src/include/pg_config.h.in index b969d8c8e6f..ef467b73866 100644 --- a/src/include/pg_config.h.in +++ b/src/include/pg_config.h.in @@ -90,9 +90,6 @@ /* Define to 1 if you have the `append_history' function. */ #undef HAVE_APPEND_HISTORY -/* Define to 1 if you have the `atexit' function. */ -#undef HAVE_ATEXIT - /* Define to 1 if you have the `cbrt' function. */ #undef HAVE_CBRT @@ -369,9 +366,6 @@ /* Define to 1 if you have the <net/if.h> header file. */ #undef HAVE_NET_IF_H -/* Define to 1 if you have the `on_exit' function. */ -#undef HAVE_ON_EXIT - /* Define to 1 if you have the <ossp/uuid.h> header file. */ #undef HAVE_OSSP_UUID_H diff --git a/src/include/pg_config.h.win32 b/src/include/pg_config.h.win32 index e568a03519e..35294e9f124 100644 --- a/src/include/pg_config.h.win32 +++ b/src/include/pg_config.h.win32 @@ -72,9 +72,6 @@ # define gettimeofday(a,b) gettimeofday(a) #endif -/* Define to 1 if you have the `atexit' function. */ -#define HAVE_ATEXIT 1 - /* Define to 1 if you have the `cbrt' function. */ //#define HAVE_CBRT 1 @@ -279,9 +276,6 @@ /* Define to 1 if you have the <netinet/tcp.h> header file. */ /* #undef HAVE_NETINET_TCP_H */ -/* Define to 1 if you have the `on_exit' function. */ -/* #undef HAVE_ON_EXIT */ - /* Define to 1 if you have the <pam/pam_appl.h> header file. */ /* #undef HAVE_PAM_PAM_APPL_H */ |