diff options
Diffstat (limited to 'linuxthreads')
-rw-r--r-- | linuxthreads/ChangeLog | 5 | ||||
-rw-r--r-- | linuxthreads/pthread.c | 15 |
2 files changed, 11 insertions, 9 deletions
diff --git a/linuxthreads/ChangeLog b/linuxthreads/ChangeLog index 978aa67d1f..84f67b8705 100644 --- a/linuxthreads/ChangeLog +++ b/linuxthreads/ChangeLog @@ -1,3 +1,8 @@ +2000-08-10 Ulrich Drepper <drepper@redhat.com> + + * pthread.c (__pthread_initial_thread): Initialize p_errnop and + p_h_errnop correctly and not to NULL. + 2000-08-05 Ulrich Drepper <drepper@redhat.com> * Banner: Bump version number to 0.9. diff --git a/linuxthreads/pthread.c b/linuxthreads/pthread.c index 514ba5b71f..646a0049b7 100644 --- a/linuxthreads/pthread.c +++ b/linuxthreads/pthread.c @@ -41,6 +41,10 @@ extern struct __res_state _res; # error "This must not happen; new kernel assumed but old headers" #endif +/* These variables are used by the setup code. */ +extern int _errno; +extern int _h_errno; + /* Descriptor of the initial thread */ struct _pthread_descr_struct __pthread_initial_thread = { @@ -70,9 +74,9 @@ struct _pthread_descr_struct __pthread_initial_thread = { 0, /* char p_cancelstate */ 0, /* char p_canceltype */ 0, /* char p_canceled */ - NULL, /* int *p_errnop */ + &_errno, /* int *p_errnop */ 0, /* int p_errno */ - NULL, /* int *p_h_errnop */ + &_h_errno, /* int *p_h_errnop */ 0, /* int p_h_errno */ NULL, /* char * p_in_sighandler */ 0, /* char p_sigwaiting */ @@ -209,10 +213,6 @@ const int __pthread_offsetof_pid = offsetof(struct _pthread_descr_struct, const int __linuxthread_pthread_sizeof_descr = sizeof(struct _pthread_descr_struct); -/* These variables are used by the setup code. */ -extern int _errno; -extern int _h_errno; - /* Forward declarations */ static void pthread_exit_process(int retcode, void *arg); @@ -376,9 +376,6 @@ extern void *__dso_handle __attribute__ ((weak)); void __pthread_initialize_minimal(void) { - /* The errno/h_errno variable of the main thread are the global ones. */ - __pthread_initial_thread.p_errnop = &_errno; - __pthread_initial_thread.p_h_errnop = &_h_errno; /* If we have special thread_self processing, initialize that for the main thread now. */ #ifdef INIT_THREAD_SELF |