summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libexec/ld.so/dlfcn.c8
-rw-r--r--libexec/ld.so/library_subr.c5
2 files changed, 6 insertions, 7 deletions
diff --git a/libexec/ld.so/dlfcn.c b/libexec/ld.so/dlfcn.c
index 95481cb20bb..3027141f6f6 100644
--- a/libexec/ld.so/dlfcn.c
+++ b/libexec/ld.so/dlfcn.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dlfcn.c,v 1.61 2005/10/03 21:01:37 kurt Exp $ */
+/* $OpenBSD: dlfcn.c,v 1.62 2005/10/05 21:50:53 kurt Exp $ */
/*
* Copyright (c) 1998 Per Fogelstrom, Opsycon AB
@@ -69,8 +69,7 @@ dlopen(const char *libname, int flags)
_dl_loading_object = object;
- if (object->opencount == 0)
- _dl_link_dlopen(object);
+ _dl_link_dlopen(object);
if (++object->refcount > 1)
goto loaded;
@@ -147,9 +146,6 @@ dlopen(const char *libname, int flags)
}
loaded:
- if (failed == 0)
- object->opencount++;
-
_dl_loading_object = NULL;
if (_dl_debug_map->r_brk) {
diff --git a/libexec/ld.so/library_subr.c b/libexec/ld.so/library_subr.c
index 44e9a30b178..4347aec0472 100644
--- a/libexec/ld.so/library_subr.c
+++ b/libexec/ld.so/library_subr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: library_subr.c,v 1.15 2005/10/03 19:48:24 kurt Exp $ */
+/* $OpenBSD: library_subr.c,v 1.16 2005/10/05 21:50:53 kurt Exp $ */
/*
* Copyright (c) 2002 Dale Rahn
@@ -338,6 +338,9 @@ _dl_link_dlopen(elf_object_t *dep)
{
struct dep_node *n;
+ if (dep->opencount++ > 0)
+ return;
+
n = _dl_malloc(sizeof *n);
if (n == NULL)
_dl_exit(5);