mirror of
https://github.com/FirebirdSQL/firebird.git
synced 2025-01-23 19:23:03 +01:00
1. Make use of gds__log_status() more consustent (no Database: line in log when database is not specified).
2. A bit better logic when error happens during provider shutdown.
This commit is contained in:
parent
33a1fa74f4
commit
58f8675e57
@ -550,7 +550,7 @@ void ERR_punt(void)
|
||||
if (dbb && (dbb->dbb_flags & DBB_bugcheck))
|
||||
{
|
||||
gds__log_status(tdbb->getAttachment()->att_filename.hasData() ?
|
||||
tdbb->getAttachment()->att_filename.c_str() : "Database unknown in ERR_punt on bugcheck",
|
||||
tdbb->getAttachment()->att_filename.c_str() : NULL,
|
||||
tdbb->tdbb_status_vector);
|
||||
if (Config::getBugcheckAbort())
|
||||
{
|
||||
|
@ -1305,8 +1305,15 @@ void API_ROUTINE gds__log_status(const TEXT* database,
|
||||
|
||||
TEXT* p = buffer;
|
||||
const TEXT* const end = p + BUFFER_XLARGE;
|
||||
if (database)
|
||||
{
|
||||
const int max_db_len = int(BUFFER_XLARGE - 12);
|
||||
sprintf(p, "Database: %.*s", max_db_len, (database) ? database : "");
|
||||
sprintf(p, "Database: %.*s", max_db_len, database);
|
||||
}
|
||||
else
|
||||
{
|
||||
*p = 0;
|
||||
}
|
||||
|
||||
do {
|
||||
while (*p)
|
||||
|
@ -6093,13 +6093,21 @@ ISC_STATUS API_ROUTINE fb__shutdown(ISC_STATUS* user_status)
|
||||
if (ShutChain::run(FB_SHUT_PREPROVIDERS) == 0)
|
||||
{
|
||||
// Shutdown providers
|
||||
ISC_STATUS* curStatus = status;
|
||||
ISC_STATUS_ARRAY tempStatus;
|
||||
for (int n = 0; n < SUBSYSTEMS; ++n)
|
||||
{
|
||||
PTR entry = get_entrypoint(PROC_SHUTDOWN, n);
|
||||
if (entry != no_entrypoint)
|
||||
{
|
||||
if (entry(status) != FB_SUCCESS)
|
||||
break;
|
||||
if (entry(curStatus) != FB_SUCCESS)
|
||||
{
|
||||
// Log error
|
||||
gds__log("Error shutting down subsystem");
|
||||
gds__log_status(0, curStatus);
|
||||
// Preserve first error, which happened
|
||||
curStatus = tempStatus;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -526,7 +526,7 @@ static void shutdownInit()
|
||||
fb__shutdown_callback(status, shutdownInetServer, FB_SHUT_POSTPROVIDERS);
|
||||
if (status[0] == 1 && status[1] > 0)
|
||||
{
|
||||
gds__log_status("shutdownInit", status);
|
||||
gds__log_status("Error in shutdownInit()", status);
|
||||
isc_print_status(status);
|
||||
exit(STARTUP_ERROR);
|
||||
}
|
||||
|
@ -3642,7 +3642,7 @@ static bool process_packet(rem_port* port,
|
||||
memset(local_status, 0, sizeof(local_status));
|
||||
|
||||
Firebird::stuff_exception(local_status, ex);
|
||||
gds__log_status("unknown, SERVER/process_packet", local_status);
|
||||
gds__log_status(0, local_status);
|
||||
|
||||
/* It would be nice to log an error to the user, instead of just terminating them! */
|
||||
port->send_response(sendL, 0, 0, local_status, false);
|
||||
|
Loading…
Reference in New Issue
Block a user