Index: ossp-pkg/fsl/TODO RCS File: /v/ossp/cvs/ossp-pkg/fsl/Attic/TODO,v rcsdiff -q -kk '-r1.5' '-r1.6' -u '/v/ossp/cvs/ossp-pkg/fsl/Attic/TODO,v' 2>/dev/null --- TODO 2002/07/30 11:50:00 1.5 +++ TODO 2002/07/30 12:03:36 1.6 @@ -1,3 +1,2 @@ -- allow syslog() without previous openlog()?! - cfg_destroy fixing and use it - runtime version check for sub libraries Index: ossp-pkg/fsl/fsl.c RCS File: /v/ossp/cvs/ossp-pkg/fsl/fsl.c,v rcsdiff -q -kk '-r1.40' '-r1.41' -u '/v/ossp/cvs/ossp-pkg/fsl/fsl.c,v' 2>/dev/null --- 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;