aboutsummaryrefslogtreecommitdiff
path: root/elf/constload1.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2000-08-15 08:23:49 +0000
committerUlrich Drepper <drepper@redhat.com>2000-08-15 08:23:49 +0000
commit805d2e7d47affd899bd5103049fd154a0b2302c7 (patch)
treed31a1e96b9d3e7a167c590a185a4a6edd0b5b7ef /elf/constload1.c
parentfc7f617d300f075fe28567391b10b4c5d64be46f (diff)
downloadglibc-805d2e7d47affd899bd5103049fd154a0b2302c7.tar
glibc-805d2e7d47affd899bd5103049fd154a0b2302c7.tar.gz
glibc-805d2e7d47affd899bd5103049fd154a0b2302c7.tar.bz2
glibc-805d2e7d47affd899bd5103049fd154a0b2302c7.zip
Update.
* elf/constload1.c: Call mtrace. Check return value of dlclose call. * elf/constload2.c: Add destructor to unload constload3.
Diffstat (limited to 'elf/constload1.c')
-rw-r--r--elf/constload1.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/elf/constload1.c b/elf/constload1.c
index 1435284c62..4640b774cb 100644
--- a/elf/constload1.c
+++ b/elf/constload1.c
@@ -1,6 +1,7 @@
#include <dlfcn.h>
#include <errno.h>
#include <error.h>
+#include <mcheck.h>
#include <stdlib.h>
int
@@ -10,11 +11,17 @@ main (void)
void *h;
int ret;
+ mtrace ();
+
h = dlopen ("constload2.so", RTLD_LAZY | RTLD_GLOBAL);
if (h == NULL)
error (EXIT_FAILURE, errno, "cannot load module \"constload2.so\"");
foo = dlsym (h, "foo");
ret = foo ();
- dlclose (h);
+ if (dlclose (h) != 0)
+ {
+ puts ("failed to close");
+ exit (EXIT_FAILURE);
+ }
return ret;
}