-const char errlog_rcs[] = "$Id: errlog.c,v 1.97 2009/06/14 15:59:56 fabiankeil Exp $";
+const char errlog_rcs[] = "$Id: errlog.c,v 1.100 2010/01/03 12:37:14 fabiankeil Exp $";
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/errlog.c,v $
* Currently we reopen it every time the config file
* has been reloaded, but actually we only have to
* reopen it if the file name changed or if the
- * configuration reloas was caused by a SIGHUP.
+ * configuration reload was caused by a SIGHUP.
*/
log_error(LOG_LEVEL_INFO, "Failed to reopen logfile: \'%s\'. "
"Retrying after closing the old file descriptor first. If that "
{
fclose(logfp);
}
+#ifdef unix
+ if (daemon_mode && (logfp == stderr))
+ {
+ if (dup2(1, 2) == -1)
+ {
+ /*
+ * We only use fatal_error() to clear the pid
+ * file and to exit. Given that stderr has just
+ * been closed, the user will not see the error
+ * message.
+ */
+ fatal_error("Failed to reserve fd 2.");
+ }
+ }
+#endif
logfp = fp;
unlock_logfile();