diff options
Diffstat (limited to 'lib/libpthread/thread/thr_fork.c')
-rw-r--r-- | lib/libpthread/thread/thr_fork.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/lib/libpthread/thread/thr_fork.c b/lib/libpthread/thread/thr_fork.c index b8d72dc..08ea812 100644 --- a/lib/libpthread/thread/thr_fork.c +++ b/lib/libpthread/thread/thr_fork.c @@ -33,6 +33,7 @@ */ #include <errno.h> #include <string.h> +#include <stdlib.h> #include <unistd.h> #include <fcntl.h> #ifdef _THREAD_SAFE @@ -130,29 +131,28 @@ fork(void) pthread_save, tle); if (pthread_save->attr.stackaddr_attr == - NULL && pthread_save->stack != NULL) + NULL && pthread_save->stack != NULL) { if (pthread_save->attr.stacksize_attr == PTHREAD_STACK_DEFAULT) { /* - * Default-size stack. Cache - * it: + * Default-size stack. + * Cache it: */ struct stack *spare_stack; spare_stack = (pthread_save->stack - + PTHREAD_STACK_DEFAULT - - sizeof(struct stack)); - SLIST_INSERT_HEAD( - &_stackq, - spare_stack, - qe); + + PTHREAD_STACK_DEFAULT + - sizeof(struct stack)); + SLIST_INSERT_HEAD(&_stackq, + spare_stack, qe); } else /* * Free the stack of * the dead thread: */ free(pthread_save->stack); + } if (pthread_save->specific_data != NULL) free(pthread_save->specific_data); |