Re: pgsql: Provide a more accurate, detailed log message when the archive - Mailing list pgsql-committers

From Bjorn Munch
Subject Re: pgsql: Provide a more accurate, detailed log message when the archive
Date
Msg-id 20071212131743.GA8400@atum07.norway.sun.com
Whole thread Raw
In response to pgsql: Provide a more accurate, detailed log message when the archive  (petere@postgresql.org (Peter Eisentraut))
Responses Re: pgsql: Provide a more accurate, detailed log message when the archive  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-committers
PostgreSQL fails to compile with Sun Studio 12, due to this new code
in backend/postmaster/pgarch.c, more precisely the last line before
the #endif (line 506):

-----
#if defined(WIN32)
                        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."),
#elif defined(HAVE_DECL_SYS_SIGLIST) && HAVE_DECL_SYS_SIGLIST
                        errmsg("archive command was terminated by signal %d: %s",
                               WTERMSIG(rc),
                               WTERMSIG(rc) < NSIG ? sys_siglist[WTERMSIG(rc)] : "(unknown)"),
#else
                        errmsg("archive command was terminated by signal %d", WTERMSIG(exitstatus)),
#endif
-----

Note the conditional compile here.  The last case appears to have been
partly cut-and-pasted from postmaster.c as it refers to the variable
'exitstatus' which does not exist here, I suppose it should have been
'rc'?

It does work with Studio 11 (or gcc).  Why Studio 12 causes configure
to undefine or unset HAVE_DECL_SYS_SIGLIST I haven't investigated.  In
any case, the above may fail to compile also with other compilers.

- Bjorn Munch
Sun Microsystems
Database Technology Group, Trondheim, Norway

pgsql-committers by date:

Previous
From: conni@pgfoundry.org (User Conni)
Date:
Subject: press - pr: Corrections
Next
From: tgl@postgresql.org (Tom Lane)
Date:
Subject: pgsql: Clean up unportable attempt to use #if inside a macro call, also