diff options
author | Ulrich Drepper <drepper@redhat.com> | 2000-08-15 08:23:49 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 2000-08-15 08:23:49 +0000 |
commit | 805d2e7d47affd899bd5103049fd154a0b2302c7 (patch) | |
tree | d31a1e96b9d3e7a167c590a185a4a6edd0b5b7ef /elf/constload2.c | |
parent | fc7f617d300f075fe28567391b10b4c5d64be46f (diff) | |
download | glibc-805d2e7d47affd899bd5103049fd154a0b2302c7.zip glibc-805d2e7d47affd899bd5103049fd154a0b2302c7.tar.gz glibc-805d2e7d47affd899bd5103049fd154a0b2302c7.tar.bz2 |
Update.
* elf/constload1.c: Call mtrace. Check return value of dlclose call.
* elf/constload2.c: Add destructor to unload constload3.
Diffstat (limited to 'elf/constload2.c')
-rw-r--r-- | elf/constload2.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/elf/constload2.c b/elf/constload2.c index f109838..d20e6dc 100644 --- a/elf/constload2.c +++ b/elf/constload2.c @@ -1,4 +1,6 @@ #include <dlfcn.h> +#include <stdio.h> +#include <stdlib.h> extern int bar (void); @@ -21,4 +23,24 @@ __attribute__ ((__constructor__)) init (void) { h = dlopen ("constload3.so", RTLD_GLOBAL | RTLD_LAZY); + if (h == NULL) + { + puts ("failed to load constload3"); + exit (1); + } + else + puts ("succeeded loading constload3"); +} + +static void +__attribute__ ((__destructor__)) +fini (void) +{ + if (dlclose (h) != 0) + { + puts ("failed to unload constload3"); + exit (1); + } + else + puts ("succeeded unloading constload3"); } |