summaryrefslogtreecommitdiff
path: root/lib/librthread/rthread_tls.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/librthread/rthread_tls.c')
-rw-r--r--lib/librthread/rthread_tls.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/librthread/rthread_tls.c b/lib/librthread/rthread_tls.c
index e510aa589b5..05311c11d7e 100644
--- a/lib/librthread/rthread_tls.c
+++ b/lib/librthread/rthread_tls.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rthread_tls.c,v 1.4 2005/12/14 05:38:31 tedu Exp $ */
+/* $OpenBSD: rthread_tls.c,v 1.5 2005/12/14 05:42:07 tedu Exp $ */
/*
* Copyright (c) 2004 Ted Unangst <tedu@openbsd.org>
* All Rights Reserved.
@@ -72,6 +72,9 @@ int
pthread_key_delete(pthread_key_t key)
{
+ if (rkeys[key].used)
+ return (EINVAL);
+
_spinlock(&rkeyslock);
rkeys[key].used = 0;
rkeys[key].destructor = NULL;