From 026910e96dd80d193d80ec1e25a5aa40fd0639dd Mon Sep 17 00:00:00 2001 From: Ian Barwick Date: Tue, 30 Jun 2015 15:35:44 +0900 Subject: [PATCH] Check for zero exit codes Also fix program name in logging output --- bdr_init_copy.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/bdr_init_copy.c b/bdr_init_copy.c index d2f0298d57..b7892732aa 100644 --- a/bdr_init_copy.c +++ b/bdr_init_copy.c @@ -682,7 +682,7 @@ run_basebackup(const char *remote_connstr, const char *data_dir) destroyPQExpBuffer(cmd); - if (WIFEXITED(ret) && WEXITSTATUS(ret)) + if (WIFEXITED(ret) && WEXITSTATUS(ret) == 0) return; if (WIFEXITED(ret)) die(_("pg_basebackup failed with exit status %d, cannot continue.\n"), WEXITSTATUS(ret)); @@ -709,14 +709,14 @@ set_sysid(uint64 sysid) destroyPQExpBuffer(cmd); - if (WIFEXITED(ret) && WEXITSTATUS(ret)) + if (WIFEXITED(ret) && WEXITSTATUS(ret) == 0) return; if (WIFEXITED(ret)) - die(_("pg_basebackup failed with exit status %d, cannot continue.\n"), WEXITSTATUS(ret)); + die(_("bdr_resetxlog failed with exit status %d, cannot continue.\n"), WEXITSTATUS(ret)); else if (WIFSIGNALED(ret)) - die(_("pg_basebackup exited with signal %d, cannot continue"), WTERMSIG(ret)); + die(_("bdr_resetxlog exited with signal %d, cannot continue"), WTERMSIG(ret)); else - die(_("pg_basebackup exited for an unknown reason (system() returned %d)"), ret); + die(_("bdr_resetxlog exited for an unknown reason (system() returned %d)"), ret); } /* -- 2.39.5