1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-30 21:42:05 +03:00

Fix problem with infinite recursion between write_syslogger_file and

elog if the former has trouble writing its file.  Code review for
Magnus' patch to redirect stderr to syslog on Windows (Bruce's version
seems right, but did some minor prettification).

Backpatch both changes to 8.0 branch.
This commit is contained in:
Tom Lane
2005-03-12 01:54:44 +00:00
parent b9de4a26cf
commit a214e9c996
2 changed files with 15 additions and 11 deletions

View File

@ -18,7 +18,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/postmaster/syslogger.c,v 1.13 2005/03/10 07:14:03 neilc Exp $
* $PostgreSQL: pgsql/src/backend/postmaster/syslogger.c,v 1.14 2005/03/12 01:54:44 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@ -679,10 +679,9 @@ write_syslogger_file_binary(const char *buffer, int count)
LeaveCriticalSection(&sysfileSection);
#endif
/* can't use ereport here because of possible recursion */
if (rc != count)
ereport(LOG,
(errcode_for_file_access(),
errmsg("could not write to log file: %m")));
write_stderr("could not write to log file: %s\n", strerror(errno));
}
#ifdef WIN32