Don't call openlog() and closelog(). Assume that the application

takes care of that.
This commit is contained in:
John Polstra 1998-11-18 01:21:46 +00:00
parent 4adeb82df8
commit 0c6b630e95

View File

@ -351,6 +351,7 @@ void pam_vsystem_log(const pam_handle_t *pamh,
D(("pam_vsystem_log called"));
#ifndef __FreeBSD__
/* make sure we have a log state to use */
if (NULL == log_state) {
if (NULL != pamh && NULL != pamh->pam_default_log.ident) {
@ -366,9 +367,12 @@ void pam_vsystem_log(const pam_handle_t *pamh,
} else {
openlog(log_state->ident, log_state->option, log_state->facility);
}
#endif
vsyslog(priority, format, args);
#ifndef __FreeBSD__
closelog();
#endif
D(("done."));
}
@ -383,6 +387,7 @@ void pam_system_log(const pam_handle_t *pamh,
D(("pam_system_log called"));
#ifndef __FreeBSD__
/* make sure we have a log state to use */
if (NULL == log_state) {
if (NULL != pamh && NULL != pamh->pam_default_log.ident) {
@ -398,11 +403,14 @@ void pam_system_log(const pam_handle_t *pamh,
} else {
openlog(log_state->ident, log_state->option, log_state->facility);
}
#endif
va_start(args, format);
vsyslog(priority, format, args);
va_end(args);
#ifndef __FreeBSD__
closelog();
#endif
D(("done."));
}