[vtkusers] vtkDynamicLoader::CloseLibrary bug?

Mathieu Malaterre mathieu.malaterre at kitware.com
Wed Jul 14 07:43:25 EDT 2004


Evan,

	You are right this is a bug in VTK. Thanks for the patch.

http://vtk.org/Bug/bug.php?op=show&bugid=984&pos=0

Mathieu

Evan Daniel wrote:
> I think that vtkDynamicLoader::CloseLibrary misbehaves on UNIX/Linux,
> cvs version of VTK.
> 
>>From the vtk documentation:
>  int vtkDynamicLoader::CloseLibrary  	(vtkLibHandle)   	 [static]
> Attempt to detach a dynamic library from the process. A value of true
> is returned if it is successful.
> 
>>From man 3 dlclose:
> dlclose returns 0 on success, and non-zero on error.
> 
> The code:
> 
> int vtkDynamicLoader::CloseLibrary(vtkLibHandle lib)
> {
>   return (int)dlclose(lib);
> }
> 
> This seems to be in error;  the patch below fixes it.
> 
> Evan Daniel
> 
> 
> Index: Common/vtkDynamicLoader.cxx
> ===================================================================
> RCS file: /cvsroot/VTK/VTK/Common/vtkDynamicLoader.cxx,v
> retrieving revision 1.18
> diff -u -r1.18 vtkDynamicLoader.cxx
> --- Common/vtkDynamicLoader.cxx       17 Feb 2004 20:31:01 -0000      1.18
> +++ Common/vtkDynamicLoader.cxx       1 Jul 2004 18:42:59 -0000
> @@ -237,7 +237,7 @@
>  
>  int vtkDynamicLoader::CloseLibrary(vtkLibHandle lib)
>  {
> -  return (int)dlclose(lib);
> +  return !((int)dlclose(lib));
>  }
>  
>  void* vtkDynamicLoader::GetSymbolAddress(vtkLibHandle lib, const char* sym)
> _______________________________________________
> This is the private VTK discussion list. 
> Please keep messages on-topic. Check the FAQ at: <http://public.kitware.com/cgi-bin/vtkfaq>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
> 






More information about the vtkusers mailing list