because it treated the supplied memory as holding an internal data
structure instead of as the stack space itself
ok kurt@, "looks ok" otto@, tested on hppa by kettenis@
-/* $OpenBSD: uthread_create.c,v 1.21 2005/01/23 19:23:47 kettenis Exp $ */
+/* $OpenBSD: uthread_create.c,v 1.22 2008/07/07 04:59:22 guenther Exp $ */
/*
* Copyright (c) 1995-1998 John Birrell <jb@cimlogic.com.au>
* All rights reserved.
} else {
pattr = *attr;
}
- /* Check if a stack was specified in the thread attributes: */
- if ((stack = pattr->stackaddr_attr) != NULL) {
- }
+
/* Allocate a stack: */
- else {
- stack = _thread_stack_alloc(pattr->stackaddr_attr,
- pattr->stacksize_attr);
- if (stack == NULL) {
- ret = EAGAIN;
- free(new_thread);
- }
+ stack = _thread_stack_alloc(pattr->stackaddr_attr,
+ pattr->stacksize_attr);
+ if (stack == NULL) {
+ ret = EAGAIN;
+ free(new_thread);
}
/* Check for errors: */