From ca3a7bccf45390f8008dd4cf6f38c6771c2f2109 Mon Sep 17 00:00:00 2001 From: Brad Smith Date: Mon, 16 Feb 2004 22:51:12 +0000 Subject: fixes function parameters to match the man page as well as adding a more aggressive arguement check. From: FreeBSD's libc_r. ok marc@ --- lib/libpthread/uthread/uthread_create.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'lib/libpthread/uthread') 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 * 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. -- cgit v1.2.3