diff options
author | Gary Mills <gary_mills@fastmail.fm> | 2018-09-27 08:43:51 -0500 |
---|---|---|
committer | Dan McDonald <danmcd@joyent.com> | 2018-09-28 13:16:32 -0400 |
commit | 42e00f035d368f958a26818f8991759a087b374d (patch) | |
tree | 66fd5e38d9d7dccd78e9be66a7be023cfebb8cb5 | |
parent | 35b5a2ef2c05b7c6ccdf28298cd7c084c454649d (diff) | |
download | illumos-joyent-42e00f035d368f958a26818f8991759a087b374d.tar.gz |
9856 pkcs11_tpm.so.1 changes syslog facility
Reviewed by: Jason King <jason.brian.king@gmail.com>
Reviewed by: Andy Fiddaman <omnios@citrus-it.net>
Approved by: Dan McDonald <danmcd@joyent.com>
-rw-r--r-- | usr/src/lib/pkcs11/pkcs11_tpm/common/apiutil.c | 17 |
1 files 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 <alloca.h> @@ -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; |