medfall

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit 3d53ac04ea38e49dfa24a9a0426809880577a190
parent a7b51adbd547b0ff43f7c1f11bf4fb58225234e9
Author: Michael Savage <mikejsavage@gmail.com>
Date:   Wed Sep 14 22:21:45 +0100

Kill the program if dlclose fails

Diffstat:
unix_library.h | 6++++--
win32_library.h | 6++++--
2 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/unix_library.h b/unix_library.h @@ -17,8 +17,10 @@ const char * library_last_error() { return dlerror(); } -bool library_close( Library lib ) { - return dlclose( lib ) == 0; +void library_close( Library lib ) { + if( dlclose( lib ) != 0 ) { + errx( 1, "dlclose: %s", dlerror() ); + } } #endif // _UNIX_LIBRARY_H_ diff --git a/win32_library.h b/win32_library.h @@ -30,8 +30,10 @@ const char * library_last_error() { return buf; } -bool library_close( Library lib ) { - return FreeLibrary( lib ) == 0; +void library_close( Library lib ) { + // return FreeLibrary( lib ) == 0; + // TODO: check for errors + FreeLibrary( lib ); } #endif // _WIN32_LIBRARY_H_