Print this page
9856 pkcs11_tpm.so.1 changes syslog facility
@@ -287,10 +287,12 @@
* (C) COPYRIGHT International Business Machines Corp. 2001, 2002
*/
/*
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
+ *
+ * Copyright 2018 Gary Mills
*/
#include <alloca.h>
#include <libgen.h>
#include <sys/varargs.h>
@@ -299,27 +301,34 @@
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*/
void
logit(int type, char *fmt, ...)
@@ -341,12 +350,11 @@
#endif /* DEBUG */
}
void
-AddToSessionList(pSess)
- Session_Struct_t *pSess;
+AddToSessionList(Session_Struct_t *pSess)
{
Session_Struct_t *pCur;
(void) pthread_mutex_lock(&(Anchor->SessListMutex));
@@ -368,12 +376,11 @@
(void) pthread_mutex_unlock(&(Anchor->SessListMutex));
}
void
-RemoveFromSessionList(pSess)
- Session_Struct_t *pSess;
+RemoveFromSessionList(Session_Struct_t *pSess)
{
Session_Struct_t *pCur, *pTmp;
(void) pthread_mutex_lock(&(Anchor->SessListMutex));