Commit 286049db authored by Tom Lane's avatar Tom Lane

Clean up unportable attempt to use #if inside a macro call, also

faulty code in third arm of #if.  Per buildfarm reports.
parent a3382de9
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/postmaster/pgarch.c,v 1.34 2007/12/12 09:39:54 petere Exp $ * $PostgreSQL: pgsql/src/backend/postmaster/pgarch.c,v 1.35 2007/12/12 16:53:14 tgl Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -489,29 +489,42 @@ pgarch_archiveXlog(char *xlog) ...@@ -489,29 +489,42 @@ pgarch_archiveXlog(char *xlog)
if (WIFEXITED(rc)) if (WIFEXITED(rc))
{ {
ereport(lev, ereport(lev,
(errmsg("archive command failed with exit code %d", WEXITSTATUS(rc)), (errmsg("archive command failed with exit code %d",
errdetail("The failed archive command was: %s", xlogarchcmd))); WEXITSTATUS(rc)),
errdetail("The failed archive command was: %s",
xlogarchcmd)));
} }
else if (WIFSIGNALED(rc)) else if (WIFSIGNALED(rc))
{ {
ereport(lev, (
#if defined(WIN32) #if defined(WIN32)
errmsg("archive command was terminated by exception 0x%X", WTERMSIG(rc)), ereport(lev,
errhint("See C include file \"ntstatus.h\" for a description of the hexadecimal value."), (errmsg("archive command was terminated by exception 0x%X",
WTERMSIG(rc)),
errhint("See C include file \"ntstatus.h\" for a description of the hexadecimal value."),
errdetail("The failed archive command was: %s",
xlogarchcmd)));
#elif defined(HAVE_DECL_SYS_SIGLIST) && HAVE_DECL_SYS_SIGLIST #elif defined(HAVE_DECL_SYS_SIGLIST) && HAVE_DECL_SYS_SIGLIST
errmsg("archive command was terminated by signal %d: %s", ereport(lev,
WTERMSIG(rc), (errmsg("archive command was terminated by signal %d: %s",
WTERMSIG(rc) < NSIG ? sys_siglist[WTERMSIG(rc)] : "(unknown)"), WTERMSIG(rc),
WTERMSIG(rc) < NSIG ? sys_siglist[WTERMSIG(rc)] : "(unknown)"),
errdetail("The failed archive command was: %s",
xlogarchcmd)));
#else #else
errmsg("archive command was terminated by signal %d", WTERMSIG(exitstatus)), ereport(lev,
(errmsg("archive command was terminated by signal %d",
WTERMSIG(rc)),
errdetail("The failed archive command was: %s",
xlogarchcmd)));
#endif #endif
errdetail("The failed archive command was: %s", xlogarchcmd)));
} }
else else
{ {
ereport(lev, ereport(lev,
(errmsg("archive command exited with unrecognized status %d", rc), (errmsg("archive command exited with unrecognized status %d",
errdetail("The failed archive command was: %s", xlogarchcmd))); rc),
errdetail("The failed archive command was: %s",
xlogarchcmd)));
} }
return false; return false;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment