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

takes care of that.
This commit is contained in:
jdp 1998-11-18 01:21:46 +00:00
parent 0c49046b10
commit dd7dc0fdc0

View File

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