summaryrefslogtreecommitdiff
path: root/libexec/ld.so
diff options
context:
space:
mode:
authorDale Rahn <drahn@cvs.openbsd.org>2001-09-22 04:29:33 +0000
committerDale Rahn <drahn@cvs.openbsd.org>2001-09-22 04:29:33 +0000
commitb62d4a186cd5ce5a4fabdf5dd26790fc3852a96b (patch)
tree122c220b739f50e669e4d57e66aa298cef13eddc /libexec/ld.so
parent93a1dd4e534f45f9405922999dbba252ddf6d74a (diff)
The unmaphints routine should not destroy the hint mapping.
Otherwise shared modules which depend on libraries cannot find them because the list of trusted directories has been lost. However we need to be careful that the unmapping of the hints frees the file descriptor, but will not free it multiple times.
Diffstat (limited to 'libexec/ld.so')
-rw-r--r--libexec/ld.so/sod.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/libexec/ld.so/sod.c b/libexec/ld.so/sod.c
index 3513c9e8228..96fe1159a25 100644
--- a/libexec/ld.so/sod.c
+++ b/libexec/ld.so/sod.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sod.c,v 1.5 2001/06/08 06:49:20 art Exp $ */
+/* $OpenBSD: sod.c,v 1.6 2001/09/22 04:29:32 drahn Exp $ */
/*
* Copyright (c) 1993 Paul Kranenburg
* All rights reserved.
@@ -194,9 +194,9 @@ _dl_unmaphints()
{
if (HINTS_VALID) {
- _dl_munmap((caddr_t)hheader, hsize);
- _dl_close(hfd);
- hheader = (void *)-1;
+ if (hfd != 0)
+ _dl_close(hfd);
+ hfd = 0;
}
}