diff options
author | Peter Eisentraut <peter_e@gmx.net> | 2013-10-01 21:24:56 -0400 |
---|---|---|
committer | Peter Eisentraut <peter_e@gmx.net> | 2013-10-09 22:48:41 -0400 |
commit | 264aa14a2f687eba8c8cc2a5b6cbd6397973da98 (patch) | |
tree | fa09ac5e9755f556542e71c4f74d8881438822a2 /contrib/pg_upgrade/parallel.c | |
parent | 261c7d4b653bc3e44c31fd456d94f292caa50d8f (diff) |
pg_upgrade: Split off pg_fatal() from pg_log()
This allows decorating pg_fatal() with noreturn compiler hints, leading
to better diagnostics.
Reviewed-by: Marko Tiikkaja <marko@joh.to>
Diffstat (limited to 'contrib/pg_upgrade/parallel.c')
-rw-r--r-- | contrib/pg_upgrade/parallel.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/contrib/pg_upgrade/parallel.c b/contrib/pg_upgrade/parallel.c index f00bb7181a7..dcd21dc5fac 100644 --- a/contrib/pg_upgrade/parallel.c +++ b/contrib/pg_upgrade/parallel.c @@ -128,7 +128,7 @@ parallel_exec_prog(const char *log_file, const char *opt_log_file, _exit(!exec_prog(log_file, opt_log_file, true, "%s", cmd)); else if (child < 0) /* fork failed */ - pg_log(PG_FATAL, "could not create worker process: %s\n", strerror(errno)); + pg_fatal("could not create worker process: %s\n", strerror(errno)); #else /* empty array element are always at the end */ new_arg = exec_thread_args[parallel_jobs - 1]; @@ -147,7 +147,7 @@ parallel_exec_prog(const char *log_file, const char *opt_log_file, child = (HANDLE) _beginthreadex(NULL, 0, (void *) win32_exec_prog, new_arg, 0, NULL); if (child == 0) - pg_log(PG_FATAL, "could not create worker thread: %s\n", strerror(errno)); + pg_fatal("could not create worker thread: %s\n", strerror(errno)); thread_handles[parallel_jobs - 1] = child; #endif @@ -242,7 +242,7 @@ parallel_transfer_all_new_dbs(DbInfoArr *old_db_arr, DbInfoArr *new_db_arr, } else if (child < 0) /* fork failed */ - pg_log(PG_FATAL, "could not create worker process: %s\n", strerror(errno)); + pg_fatal("could not create worker process: %s\n", strerror(errno)); #else /* empty array element are always at the end */ new_arg = transfer_thread_args[parallel_jobs - 1]; @@ -263,7 +263,7 @@ parallel_transfer_all_new_dbs(DbInfoArr *old_db_arr, DbInfoArr *new_db_arr, child = (HANDLE) _beginthreadex(NULL, 0, (void *) win32_transfer_all_new_dbs, new_arg, 0, NULL); if (child == 0) - pg_log(PG_FATAL, "could not create worker thread: %s\n", strerror(errno)); + pg_fatal("could not create worker thread: %s\n", strerror(errno)); thread_handles[parallel_jobs - 1] = child; #endif @@ -311,7 +311,7 @@ reap_child(bool wait_for_child) return false; if (WEXITSTATUS(work_status) != 0) - pg_log(PG_FATAL, "child worker exited abnormally: %s\n", strerror(errno)); + pg_fatal("child worker exited abnormally: %s\n", strerror(errno)); #else /* wait for one to finish */ thread_num = WaitForMultipleObjects(parallel_jobs, thread_handles, @@ -326,7 +326,7 @@ reap_child(bool wait_for_child) /* get the result */ GetExitCodeThread(thread_handles[thread_num], &res); if (res != 0) - pg_log(PG_FATAL, "child worker exited abnormally: %s\n", strerror(errno)); + pg_fatal("child worker exited abnormally: %s\n", strerror(errno)); /* dispose of handle to stop leaks */ CloseHandle(thread_handles[thread_num]); |