diff options
author | matthew <> | 2011-03-02 18:34:05 +0000 |
---|---|---|
committer | matthew <> | 2011-03-02 18:34:05 +0000 |
commit | f73a522cd2fd89bd4334320b5942cf728ab81631 (patch) | |
tree | fc80fbf1f633c0bbb33db0ac05740ace67e80d0a /src | |
parent | d1c27f232cfde582e176b277933b485ea84ac845 (diff) | |
download | openbsd-f73a522cd2fd89bd4334320b5942cf728ab81631.tar.gz openbsd-f73a522cd2fd89bd4334320b5942cf728ab81631.tar.bz2 openbsd-f73a522cd2fd89bd4334320b5942cf728ab81631.zip |
Fix __cxa_finalize() so that calling __cxa_finalize(NULL) properly
invokes handlers registered with __cxa_atexit().
"seems right" deraadt@
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/libc/stdlib/atexit.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lib/libc/stdlib/atexit.c b/src/lib/libc/stdlib/atexit.c index 4d28fb5ef6..e28ccf29d0 100644 --- a/src/lib/libc/stdlib/atexit.c +++ b/src/lib/libc/stdlib/atexit.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: atexit.c,v 1.14 2007/09/05 20:47:47 chl Exp $ */ | 1 | /* $OpenBSD: atexit.c,v 1.15 2011/03/02 18:34:05 matthew Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2002 Daniel Hartmeier | 3 | * Copyright (c) 2002 Daniel Hartmeier |
4 | * All rights reserved. | 4 | * All rights reserved. |
@@ -147,7 +147,7 @@ __cxa_finalize(void *dso) | |||
147 | p->fns[n].fn_ptr.cxa_func = NULL; | 147 | p->fns[n].fn_ptr.cxa_func = NULL; |
148 | mprotect(p, pgsize, PROT_READ); | 148 | mprotect(p, pgsize, PROT_READ); |
149 | } | 149 | } |
150 | if (dso != NULL) | 150 | if (fn.fn_dso != NULL) |
151 | (*fn.fn_ptr.cxa_func)(fn.fn_arg); | 151 | (*fn.fn_ptr.cxa_func)(fn.fn_arg); |
152 | else | 152 | else |
153 | (*fn.fn_ptr.std_func)(); | 153 | (*fn.fn_ptr.std_func)(); |