summaryrefslogtreecommitdiff
path: root/lib/libcrypt
diff options
context:
space:
mode:
authorcgd <cgd@NetBSD.org>1993-10-07 01:43:14 +0000
committercgd <cgd@NetBSD.org>1993-10-07 01:43:14 +0000
commitd86859f64475397ade70fc7d88fc0b14fa50b143 (patch)
tree7ea240b5d8033671c448def4229b8ac9b3f82707 /lib/libcrypt
parenta2d8842caefc79c68c234fec7a68355b367ada03 (diff)
print the warning exactly once per function per program invocation.
Diffstat (limited to 'lib/libcrypt')
-rw-r--r--lib/libcrypt/crypt_dummy.c37
1 files changed, 31 insertions, 6 deletions
diff --git a/lib/libcrypt/crypt_dummy.c b/lib/libcrypt/crypt_dummy.c
index 0cdf20703f6..6e3d178f74f 100644
--- a/lib/libcrypt/crypt_dummy.c
+++ b/lib/libcrypt/crypt_dummy.c
@@ -36,7 +36,7 @@
#if defined(LIBC_SCCS) && !defined(lint)
/*static char *sccsid = "from: @(#)crypt.c 5.11 (Berkeley) 6/25/91";*/
-static char *rcsid = "$Id: crypt_dummy.c,v 1.1 1993/10/07 01:36:24 cgd Exp $";
+static char *rcsid = "$Id: crypt_dummy.c,v 1.2 1993/10/07 01:43:14 cgd Exp $";
#endif /* LIBC_SCCS and not lint */
#include <unistd.h>
@@ -56,7 +56,12 @@ crypt(key, setting)
register const char *key;
register const char *setting;
{
- fprintf(stderr, "WARNING! crypt(3) not present in the system!\n");
+ static int warned;
+
+ if (!warned) {
+ fprintf(stderr, "WARNING! crypt(3) not present in the system!\n");
+ warned = 1;
+ }
strncpy(cryptresult, key, sizeof cryptresult);
cryptresult[sizeof cryptresult - 1] = '\0';
return(cryptresult);
@@ -66,7 +71,12 @@ crypt(key, setting)
des_setkey(key)
register const char *key;
{
- fprintf(stderr, "WARNING! des_setkey(3) not present in the system!\n");
+ static int warned;
+
+ if (!warned) {
+ fprintf(stderr, "WARNING! des_setkey(3) not present in the system!\n");
+ warned = 1;
+ }
return(0);
}
@@ -76,7 +86,12 @@ des_cipher(in, out, salt, num_iter)
long salt;
int num_iter;
{
- fprintf(stderr, "WARNING! des_cipher(3) not present in the system!\n");
+ static int warned;
+
+ if (!warned) {
+ fprintf(stderr, "WARNING! des_cipher(3) not present in the system!\n");
+ warned = 1;
+ }
bcopy(in, out, 8);
return(0);
}
@@ -84,7 +99,12 @@ des_cipher(in, out, salt, num_iter)
setkey(key)
register const char *key;
{
- fprintf(stderr, "WARNING! setkey(3) not present in the system!\n");
+ static int warned;
+
+ if (!warned) {
+ fprintf(stderr, "WARNING! setkey(3) not present in the system!\n");
+ warned = 1;
+ }
return(0);
}
@@ -92,7 +112,12 @@ encrypt(block, flag)
register char *block;
int flag;
{
- fprintf(stderr, "WARNING! encrypt(3) not present in the system!\n");
+ static int warned;
+
+ if (!warned) {
+ fprintf(stderr, "WARNING! encrypt(3) not present in the system!\n");
+ warned = 1;
+ }
return(0);
}