summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/libpthread/uthread/uthread_create.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/libpthread/uthread/uthread_create.c b/lib/libpthread/uthread/uthread_create.c
index 3cfbd3d6f32..8889b84ef95 100644
--- a/lib/libpthread/uthread/uthread_create.c
+++ b/lib/libpthread/uthread/uthread_create.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uthread_create.c,v 1.19 2003/07/08 00:17:19 marc Exp $ */
+/* $OpenBSD: uthread_create.c,v 1.20 2004/02/16 22:51:11 brad Exp $ */
/*
* Copyright (c) 1995-1998 John Birrell <jb@cimlogic.com.au>
* All rights reserved.
@@ -46,7 +46,7 @@
#include "pthread_private.h"
int
-pthread_create(pthread_t * thread, const pthread_attr_t * attr,
+pthread_create(pthread_t *thread, const pthread_attr_t *attr,
void *(*start_routine) (void *), void *arg)
{
struct pthread *curthread = _get_curthread();
@@ -58,6 +58,9 @@ pthread_create(pthread_t * thread, const pthread_attr_t * attr,
pthread_attr_t pattr;
struct stack *stack;
+ if (thread == NULL)
+ return(EINVAL);
+
/*
* Locking functions in libc are required when there are
* threads other than the initial thread.