summaryrefslogtreecommitdiffstats
path: root/lib/libpthread
diff options
context:
space:
mode:
authord <d@openbsd.org>1999-11-27 01:30:11 +0000
committerd <d@openbsd.org>1999-11-27 01:30:11 +0000
commit06d08fa0f92cd487be94792e8cca4714d8e72d39 (patch)
treea7815d2411725a351b4293f82c619acf7fe8c3bb /lib/libpthread
parentswitch_screen() takes three arguments, not two; d@ (diff)
downloadwireguard-openbsd-06d08fa0f92cd487be94792e8cca4714d8e72d39.tar.xz
wireguard-openbsd-06d08fa0f92cd487be94792e8cca4714d8e72d39.zip
do it the single-processor way
Diffstat (limited to 'lib/libpthread')
-rw-r--r--lib/libpthread/uthread/uthread_seterrno.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/lib/libpthread/uthread/uthread_seterrno.c b/lib/libpthread/uthread/uthread_seterrno.c
index 41425e5b134..1b008122ca3 100644
--- a/lib/libpthread/uthread/uthread_seterrno.c
+++ b/lib/libpthread/uthread/uthread_seterrno.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uthread_seterrno.c,v 1.3 1999/11/25 07:01:43 d Exp $ */
+/* $OpenBSD: uthread_seterrno.c,v 1.4 1999/11/27 01:30:11 d Exp $ */
/*
* Copyright (c) 1995 John Birrell <jb@cimlogic.com.au>.
* All rights reserved.
@@ -41,22 +41,28 @@
* normally hidden from the user.
*/
#ifdef errno
-#undef errno;
+#undef errno
#endif
extern int errno;
void
_thread_seterrno(pthread_t thread, int error)
{
- /* Check for the initial thread: */
- if (thread == _thread_initial)
- /* The initial thread always uses the global error variable: */
+
+ /* Don't allow _thread_run to change: */
+ _thread_kern_sig_defer();
+
+ /* Check for the current thread: */
+ if (thread == _thread_run)
+ /* The current thread always uses the global error variable: */
errno = error;
else
/*
- * Threads other than the initial thread always use the error
- * field in the thread structureL
+ * Threads other than the current thread will keep the error
+ * field in the thread structure:
*/
thread->error = error;
+
+ _thread_kern_sig_undefer();
}
#endif