--- fsl.c 2002/07/30 11:50:00 1.40
+++ fsl.c 2002/07/30 12:03:36 1.41
@@ -182,6 +182,7 @@
int maskpri;
int logopt;
int delayopen;
+ int openlog;
} ctx = {
NULL,
NULL,
@@ -190,6 +191,7 @@
NULL,
LOG_UPTO(LOG_DEBUG),
0,
+ FALSE,
FALSE
};
@@ -620,6 +622,7 @@
/* properly handle repeated execution */
closelog();
+ ctx.openlog = TRUE;
/* create OSSP l2 environment for fsl itself (internal logging) */
if ((argl2spec = getenv("FSL_DEBUG")) == NULL)
@@ -646,6 +649,7 @@
}
/* tracing */
+
fsldebug(L2_LEVEL_TRACE, "openlog() ident=\"%s\", logopt=0x%.8lx, facility=0x%.8lx)", ident, logopt, facility);
/* remember logopt and handle unsupported values */
@@ -777,6 +781,7 @@
ctx.maskpri = LOG_UPTO(LOG_DEBUG);
ctx.logopt = 0;
ctx.delayopen = FALSE;
+ ctx.openlog = FALSE;
return;
}
@@ -816,6 +821,10 @@
l2_result_t l2rv;
char *cp;
+ /* check for previous omitted attempt of initialization */
+ if (ctx.l2_nch == NULL && !ctx.openlog)
+ openlog("fsl", 0, LOG_SYSLOG);
+
/* check for previous proper initialization */
if (ctx.l2_nch == NULL)
return;
|