diff options
author | 2004-02-16 22:51:11 +0000 | |
---|---|---|
committer | 2004-02-16 22:51:11 +0000 | |
commit | 241f825c5b2eb72a6c25ccbfa1f25a1fe7b024d6 (patch) | |
tree | a35425d5473abd723f4943aa21c4aac93640d657 /lib/libpthread | |
parent | Add missing const for function parameters to match POSIX. (diff) | |
download | wireguard-openbsd-241f825c5b2eb72a6c25ccbfa1f25a1fe7b024d6.tar.xz wireguard-openbsd-241f825c5b2eb72a6c25ccbfa1f25a1fe7b024d6.zip |
fixes function parameters to match the man page as well
as adding a more aggressive arguement check.
From: FreeBSD's libc_r.
ok marc@
Diffstat (limited to 'lib/libpthread')
-rw-r--r-- | lib/libpthread/uthread/uthread_create.c | 7 |
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. |