diff options
Diffstat (limited to 'libc')
-rw-r--r-- | libc/stdlib/_atexit.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/libc/stdlib/_atexit.c b/libc/stdlib/_atexit.c index 3faa9f05f..8a3196781 100644 --- a/libc/stdlib/_atexit.c +++ b/libc/stdlib/_atexit.c @@ -43,6 +43,9 @@ #include <stdio.h> #include <errno.h> #include <atomic.h> +#if defined __UCLIBC_HAS_THREADS__ && defined __UCLIBC_HAS_THREADS_NATIVE__ +# include <fork.h> +#endif #include <bits/uClibc_mutex.h> __UCLIBC_MUTEX_EXTERN(__atexit_lock) attribute_hidden; @@ -208,17 +211,15 @@ void __cxa_finalize(void *dso_handle) } } -#if 0 /* haven't looked into this yet... */ /* * Remove the registered fork handlers. We do not have to * unregister anything if the program is going to terminate anyway. */ #ifdef UNREGISTER_ATFORK - if (d != NULL) { - UNREGISTER_ATFORK(d); + if (dso_handle != NULL) { + UNREGISTER_ATFORK(dso_handle); } #endif -#endif } #endif |