diff options
author | Peter Eisentraut | 2011-04-06 20:00:44 +0000 |
---|---|---|
committer | Peter Eisentraut | 2011-04-06 20:00:44 +0000 |
commit | c75163842cf93fd7b6311df2c5545bf09447b870 (patch) | |
tree | 0c43869f5e34512139b54aa206ccf0b9fec2ba4f /contrib/pg_upgrade/util.c | |
parent | 2bd78eb8d51cc9ee03ba0287b23ff4c266dcd9b9 (diff) |
Replace the confusing exit_nicely() by an atexit/on_exit hook
Diffstat (limited to 'contrib/pg_upgrade/util.c')
-rw-r--r-- | contrib/pg_upgrade/util.c | 33 |
1 files changed, 2 insertions, 31 deletions
diff --git a/contrib/pg_upgrade/util.c b/contrib/pg_upgrade/util.c index f9575081013..804aa0d1e5f 100644 --- a/contrib/pg_upgrade/util.c +++ b/contrib/pg_upgrade/util.c @@ -99,7 +99,8 @@ pg_log(eLogType type, char *fmt,...) case PG_FATAL: printf("%s", "\n"); printf("%s", _(message)); - exit_nicely(true); + printf("Failure, exiting\n"); + exit(1); break; case PG_DEBUG: @@ -184,36 +185,6 @@ get_user_info(char **user_name) } -void -exit_nicely(bool need_cleanup) -{ - stop_postmaster(true, true); - - pg_free(log_opts.filename); - - if (log_opts.fd) - fclose(log_opts.fd); - - if (log_opts.debug_fd) - fclose(log_opts.debug_fd); - - /* terminate any running instance of postmaster */ - if (os_info.postmasterPID != 0) - kill(os_info.postmasterPID, SIGTERM); - - if (need_cleanup) - { - printf("Failure, exiting\n"); - /* - * FIXME must delete intermediate files - */ - exit(1); - } - else - exit(0); -} - - void * pg_malloc(int n) { |