From 42e00f035d368f958a26818f8991759a087b374d Mon Sep 17 00:00:00 2001 From: Gary Mills Date: Thu, 27 Sep 2018 08:43:51 -0500 Subject: 9856 pkcs11_tpm.so.1 changes syslog facility Reviewed by: Jason King Reviewed by: Andy Fiddaman Approved by: Dan McDonald --- usr/src/lib/pkcs11/pkcs11_tpm/common/apiutil.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/usr/src/lib/pkcs11/pkcs11_tpm/common/apiutil.c b/usr/src/lib/pkcs11/pkcs11_tpm/common/apiutil.c index 07b6ceb656..3c969c2762 100644 --- a/usr/src/lib/pkcs11/pkcs11_tpm/common/apiutil.c +++ b/usr/src/lib/pkcs11/pkcs11_tpm/common/apiutil.c @@ -289,6 +289,8 @@ /* * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. + * + * Copyright 2018 Gary Mills */ #include @@ -301,23 +303,30 @@ extern API_Proc_Struct_t *Anchor; extern int logging; void logit(int, char *, ...); +#ifdef DEBUG static int enabled = 0; +#endif /* DEBUG */ void -loginit() { +loginit() +{ +#ifdef DEBUG if (!enabled) { enabled = 1; openlog("tpmtoken", LOG_PID | LOG_NDELAY, LOG_DAEMON); (void) setlogmask(LOG_UPTO(LOG_DEBUG)); logit(LOG_DEBUG, "Logging enabled %d enabled", enabled); } +#endif /* DEBUG */ } void logterm() { +#ifdef DEBUG closelog(); enabled = 0; +#endif /* DEBUG */ } /*ARGSUSED*/ @@ -343,8 +352,7 @@ logit(int type, char *fmt, ...) } void -AddToSessionList(pSess) - Session_Struct_t *pSess; +AddToSessionList(Session_Struct_t *pSess) { Session_Struct_t *pCur; @@ -370,8 +378,7 @@ AddToSessionList(pSess) } void -RemoveFromSessionList(pSess) - Session_Struct_t *pSess; +RemoveFromSessionList(Session_Struct_t *pSess) { Session_Struct_t *pCur, *pTmp; -- cgit v1.2.3