summaryrefslogtreecommitdiffstats
path: root/lib/libthr/thread/thr_seterrno.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libthr/thread/thr_seterrno.c')
-rw-r--r--lib/libthr/thread/thr_seterrno.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/libthr/thread/thr_seterrno.c b/lib/libthr/thread/thr_seterrno.c
index ec801d6..f481799 100644
--- a/lib/libthr/thread/thr_seterrno.c
+++ b/lib/libthr/thread/thr_seterrno.c
@@ -31,23 +31,23 @@
*
* $FreeBSD$
*/
+
#include <pthread.h>
+
#include "thr_private.h"
/*
* This function needs to reference the global error variable which is
* normally hidden from the user.
*/
-#ifdef errno
#undef errno
-#endif
extern int errno;
void
_thread_seterrno(pthread_t thread, int error)
{
/* Check for the initial thread: */
- if (thread == _thread_initial)
+ if (thread == NULL || thread == _thr_initial)
/* The initial thread always uses the global error variable: */
errno = error;
else
OpenPOWER on IntegriCloud