aboutsummaryrefslogtreecommitdiffstats
path: root/com32/lib/onexit.c
diff options
context:
space:
mode:
Diffstat (limited to 'com32/lib/onexit.c')
-rw-r--r--com32/lib/onexit.c18
1 files changed, 3 insertions, 15 deletions
diff --git a/com32/lib/onexit.c b/com32/lib/onexit.c
index 272f8f1c..8c45e3b4 100644
--- a/com32/lib/onexit.c
+++ b/com32/lib/onexit.c
@@ -4,21 +4,9 @@
#include <stdlib.h>
#include <unistd.h>
+#include <sys/module.h>
#include "atexit.h"
-static struct atexit *__atexit_list;
-
-static __noreturn on_exit_exit(int rv)
-{
- struct atexit *ap;
-
- for (ap = __atexit_list; ap; ap = ap->next) {
- ap->fctn(rv, ap->arg); /* This assumes extra args are harmless */
- }
-
- _exit(rv);
-}
-
int on_exit(void (*fctn) (int, void *), void *arg)
{
struct atexit *as = malloc(sizeof(struct atexit));
@@ -29,8 +17,8 @@ int on_exit(void (*fctn) (int, void *), void *arg)
as->fctn = fctn;
as->arg = arg;
- as->next = __atexit_list;
- __atexit_list = as;
+ as->next = __syslinux_current->u.x.atexit_list;
+ __syslinux_current->u.x.atexit_list = as;
return 0;
}