mirror of
https://github.com/postgres/postgres.git
synced 2025-08-30 06:01:21 +03:00
Print meaningfull error text for abonormal process exit on Win32, rather
than hex codes, using FormatMessage().
This commit is contained in:
@@ -9,7 +9,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/port/exec.c,v 1.45 2007/01/22 18:31:51 momjian Exp $
|
||||
* $PostgreSQL: pgsql/src/port/exec.c,v 1.46 2007/01/23 01:45:11 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -586,8 +586,24 @@ pclose_check(FILE *stream)
|
||||
log_error(_("child process was terminated by signal %d"),
|
||||
WTERMSIG(exitstatus));
|
||||
#else
|
||||
log_error(_("child process was terminated by exception %X\nSee http://source.winehq.org/source/include/ntstatus.h for a description\nof the hex value."),
|
||||
WTERMSIG(exitstatus));
|
||||
{
|
||||
static char last_system_error[512];
|
||||
|
||||
if (WERRORCODE(exitstatus) == 0 ||
|
||||
FormatMessage(FORMAT_MESSAGE_IGNORE_INSERTS |
|
||||
FORMAT_MESSAGE_FROM_SYSTEM,
|
||||
NULL,
|
||||
WERRORCODE(exitstatus),
|
||||
MAKELANGID(LANG_ENGLISH, SUBLANG_DEFAULT),
|
||||
last_system_error,
|
||||
sizeof(last_system_error) - 1,
|
||||
NULL) == 0)
|
||||
snprintf(last_system_error, sizeof(last_system_error) - 1,
|
||||
"Unknown error %X.", WEXITSTATUS(exitstatus));
|
||||
|
||||
log_error(_("child process was terminated by the operating system\n%s"),
|
||||
last_system_error);
|
||||
}
|
||||
#endif
|
||||
else
|
||||
log_error(_("child process exited with unrecognized status %d"),
|
||||
|
Reference in New Issue
Block a user