summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJerry Jelinek <jerry.jelinek@joyent.com>2018-10-01 11:54:16 +0000
committerJerry Jelinek <jerry.jelinek@joyent.com>2018-10-01 11:54:16 +0000
commit1c1a890e7ba95068bc573dd82bcec35fbe2ad66b (patch)
treee2153dbe23e01d63a9951f3db6adf69e5c1a204b
parent0a51b8dc40c8d4c15f71e64bc2126489a45d11ce (diff)
parent42e00f035d368f958a26818f8991759a087b374d (diff)
downloadillumos-joyent-1c1a890e7ba95068bc573dd82bcec35fbe2ad66b.tar.gz
[illumos-gate merge]
commit 42e00f035d368f958a26818f8991759a087b374d 9856 pkcs11_tpm.so.1 changes syslog facility
-rw-r--r--usr/src/lib/pkcs11/pkcs11_tpm/common/apiutil.c17
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;