From df30098d91d97b0b05f75fcc0d7e505abbc8ad2b Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Sun, 9 Nov 2008 18:18:51 +0000 Subject: [PATCH] unload_library() invoked from dlclose() might not have deleted images correctly and it returned an error on success. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28578 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/system/runtime_loader/elf.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/system/runtime_loader/elf.cpp b/src/system/runtime_loader/elf.cpp index 5bac30b152..fa29a15ef3 100644 --- a/src/system/runtime_loader/elf.cpp +++ b/src/system/runtime_loader/elf.cpp @@ -2295,7 +2295,6 @@ err: status_t unload_library(void* handle, image_id imageID, bool addOn) { - status_t status = B_BAD_IMAGE_ID; image_t *image; image_type type = addOn ? B_ADD_ON_IMAGE : B_LIBRARY_IMAGE; @@ -2315,9 +2314,12 @@ unload_library(void* handle, image_id imageID, bool addOn) // we only check images that have been already initialized + status_t status = B_BAD_IMAGE_ID; + if (handle != NULL) { image = (image_t*)handle; put_image(image); + status = B_OK; } else { for (image = sLoadedImages.head; image; image = image->next) { if (image->id == imageID) {