summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Leonard <d@cvs.openbsd.org>1999-05-12 06:00:01 +0000
committerDavid Leonard <d@cvs.openbsd.org>1999-05-12 06:00:01 +0000
commitd1e4242b06e8535818a59bd49dc7c1387eb2dcd0 (patch)
tree4fbf14fcc532cc926c07d9795c5f278b44fdfe85
parentc5056c968bd1e451a0b717791773db497eb9ddb8 (diff)
permit NULL result parameter for pthread_create(). Apparently used in Stevens?
-rw-r--r--lib/libc_r/uthread/uthread_create.c5
-rw-r--r--lib/libpthread/uthread/uthread_create.c5
2 files changed, 6 insertions, 4 deletions
diff --git a/lib/libc_r/uthread/uthread_create.c b/lib/libc_r/uthread/uthread_create.c
index d4542c6624b..eede7c6b5e9 100644
--- a/lib/libc_r/uthread/uthread_create.c
+++ b/lib/libc_r/uthread/uthread_create.c
@@ -29,7 +29,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $OpenBSD: uthread_create.c,v 1.8 1999/03/10 10:06:22 d Exp $
+ * $OpenBSD: uthread_create.c,v 1.9 1999/05/12 06:00:00 d Exp $
*/
#include <errno.h>
#include <stdlib.h>
@@ -174,7 +174,8 @@ pthread_create(pthread_t * thread, const pthread_attr_t * attr,
_unlock_thread_list();
/* Return a pointer to the thread structure: */
- (*thread) = new_thread;
+ if (thread != NULL)
+ (*thread) = new_thread;
/* Schedule the new user thread: */
_thread_kern_sched(NULL);
diff --git a/lib/libpthread/uthread/uthread_create.c b/lib/libpthread/uthread/uthread_create.c
index d4542c6624b..eede7c6b5e9 100644
--- a/lib/libpthread/uthread/uthread_create.c
+++ b/lib/libpthread/uthread/uthread_create.c
@@ -29,7 +29,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $OpenBSD: uthread_create.c,v 1.8 1999/03/10 10:06:22 d Exp $
+ * $OpenBSD: uthread_create.c,v 1.9 1999/05/12 06:00:00 d Exp $
*/
#include <errno.h>
#include <stdlib.h>
@@ -174,7 +174,8 @@ pthread_create(pthread_t * thread, const pthread_attr_t * attr,
_unlock_thread_list();
/* Return a pointer to the thread structure: */
- (*thread) = new_thread;
+ if (thread != NULL)
+ (*thread) = new_thread;
/* Schedule the new user thread: */
_thread_kern_sched(NULL);