-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.99 2009/12/26 11:34:01 fabiankeil Exp $";
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/errlog.c,v $
{
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();