From: Peter Ekberg Date: Thu, 28 Jul 2005 10:17:17 +0000 (+0000) Subject: * libltdl/loaders/loadlibrary.c (vm_open): Set the error mode so X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9c6f1ac4aba05cf4109b2670561c113a970866a3;p=thirdparty%2Flibtool.git * libltdl/loaders/loadlibrary.c (vm_open): Set the error mode so that no dialog is popped up in case the file given to LoadLibrary is not a dll. --- diff --git a/ChangeLog b/ChangeLog index 27837c6d2..d1fbf109c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2005-07-28 Peter Ekberg + + * libltdl/loaders/loadlibrary.c (vm_open): Set the error mode so + that no dialog is popped up in case the file given to + LoadLibrary is not a dll. + 2005-07-28 Peter Ekberg * config/ltmain.m4sh (func_mode_link) : Make sure diff --git a/libltdl/loaders/loadlibrary.c b/libltdl/loaders/loadlibrary.c index 9e60d13c7..97d14fe69 100644 --- a/libltdl/loaders/loadlibrary.c +++ b/libltdl/loaders/loadlibrary.c @@ -125,15 +125,26 @@ vm_open (lt_user_data loader_data, const char *filename) if (!searchname) return 0; -#if defined(__CYGWIN__) { - char wpath[MAX_PATH]; - cygwin_conv_to_full_win32_path(searchname, wpath); - module = LoadLibrary(wpath); - } + /* Silence dialog from LoadLibrary on some failures. + No way to get the error mode, but to set it, + so set it twice to preserve any previous flags. */ + UINT errormode = SetErrorMode(SEM_FAILCRITICALERRORS); + SetErrorMode(errormode | SEM_FAILCRITICALERRORS); + +#if defined(__CYGWIN__) + { + char wpath[MAX_PATH]; + cygwin_conv_to_full_win32_path (searchname, wpath); + module = LoadLibrary (wpath); + } #else - module = LoadLibrary (searchname); + module = LoadLibrary (searchname); #endif + + /* Restore the error mode. */ + SetErrorMode(errormode); + } FREE (searchname); /* libltdl expects this function to fail if it is unable