mirror of
https://github.com/opnsense/src.git
synced 2026-06-14 19:20:18 -04:00
Reference an external variable in threaded programs so that the
autoinitialiser gets linked in and therefore called before main().
This commit is contained in:
parent
7317e6b1fd
commit
96c76d66db
1 changed files with 6 additions and 0 deletions
|
|
@ -60,6 +60,12 @@ exit(status)
|
|||
register struct atexit *p;
|
||||
register int n;
|
||||
|
||||
#ifdef _THREAD_SAFE
|
||||
extern int _thread_autoinit_dummy_decl;
|
||||
/* Ensure that the auto-initialization routine is linked in: */
|
||||
_thread_autoinit_dummy_decl = 1;
|
||||
#endif
|
||||
|
||||
for (p = __atexit; p; p = p->next)
|
||||
for (n = p->ind; --n >= 0;)
|
||||
(*p->fns[n])();
|
||||
|
|
|
|||
Loading…
Reference in a new issue