* unload_elf_image() never unloaded any image because the ref_count

check was wrong (never gets below zero if everything goes as 
  intended).
* Removed erroneous white space.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24232 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler 2008-03-04 12:36:53 +00:00
parent e5a5ee6eb8
commit 890c615aee

View File

@ -1,5 +1,5 @@
/*
* Copyright 2002-2007, Axel Dörfler, axeld@pinc-software.de. All rights reserved.
* Copyright 2002-2008, Axel Dörfler, axeld@pinc-software.de. All rights reserved.
* Distributed under the terms of the MIT License.
*
* Copyright 2001, Travis Geiselbrecht. All rights reserved.
@ -684,8 +684,10 @@ elf_unlink_relocs(struct elf_image_info *image)
static status_t
unload_elf_image(struct elf_image_info *image)
{
if (atomic_add(&image->ref_count, -1) > 0)
return B_NO_ERROR;
if (atomic_add(&image->ref_count, -1) > 1)
return B_OK;
TRACE(("unload image %ld, %s\n", image->id, image->name));
//elf_unlink_relocs(image);
// not yet used