summaryrefslogtreecommitdiff
path: root/usr/src/lib/libcryptoutil/common/debug.c
diff options
context:
space:
mode:
authorAnthony Scarpino <Anthony.Scarpino@Sun.COM>2008-12-08 14:08:48 -0800
committerAnthony Scarpino <Anthony.Scarpino@Sun.COM>2008-12-08 14:08:48 -0800
commita7e661a2db6ff10cd43a089e7f4dcbd0cfd609f1 (patch)
treeecdc4ead234585574bb80c075a3ee08852c62999 /usr/src/lib/libcryptoutil/common/debug.c
parent052576a327519e946a54d8455e94f605d1505992 (diff)
downloadillumos-gate-a7e661a2db6ff10cd43a089e7f4dcbd0cfd609f1.tar.gz
6773289 libcryptoutil needs to interact with calling functions better
Diffstat (limited to 'usr/src/lib/libcryptoutil/common/debug.c')
-rw-r--r--usr/src/lib/libcryptoutil/common/debug.c24
1 files changed, 17 insertions, 7 deletions
diff --git a/usr/src/lib/libcryptoutil/common/debug.c b/usr/src/lib/libcryptoutil/common/debug.c
index 9dcfe19a87..84ac2ec4be 100644
--- a/usr/src/lib/libcryptoutil/common/debug.c
+++ b/usr/src/lib/libcryptoutil/common/debug.c
@@ -2,9 +2,8 @@
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License"). You may not use this file except in compliance
- * with the License.
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
@@ -20,12 +19,10 @@
* CDDL HEADER END
*/
/*
- * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
-#pragma ident "%Z%%M% %I% %E% SMI"
-
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
@@ -37,6 +34,7 @@
static char *_cryptodebug_prefix = NULL;
static int _cryptodebug_enabled = -1; /* -1 unknown, 0 disabled, 1 enabled */
+static int _cryptoerror_enabled = 1; /* 0 disabled, 1 enabled */
static boolean_t _cryptodebug_syslog = B_TRUE;
/*PRINTFLIKE1*/
@@ -89,7 +87,7 @@ cryptoerror(int priority, const char *fmt, ...)
char msgbuf[BUFSIZ];
va_list args;
- if (fmt == NULL)
+ if (fmt == NULL || _cryptoerror_enabled == 0)
return;
va_start(args, fmt);
@@ -110,6 +108,18 @@ cryptoerror(int priority, const char *fmt, ...)
}
void
+cryptoerror_off()
+{
+ _cryptoerror_enabled = 0;
+}
+
+void
+cryptoerror_on()
+{
+ _cryptoerror_enabled = 1;
+}
+
+void
cryptodebug_init(const char *prefix)
{
char *envval = NULL;