From: Peter Ekberg Date: Wed, 3 Aug 2005 14:04:22 +0000 (+0000) Subject: * libltdl/ltdl.c (sys_wll_open): Set the error mode so that no X-Git-Tag: release-1-5-20~15 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=722122b6789e6900aea74b444124bf4c8f827b57;p=thirdparty%2Flibtool.git * libltdl/ltdl.c (sys_wll_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 078e8b204..8d8b6f49e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2005-08-03 Peter Ekberg + * libltdl/ltdl.c (sys_wll_open): Set the error mode so that no + dialog is popped up in case the file given to LoadLibrary is not + a dll. + * ltmain.in (link mode): Properly remove the fake symbol line ": @PROGRAM " from the list of exported symbols. diff --git a/libltdl/ltdl.c b/libltdl/ltdl.c index 4b99e742c..b1a0e38ae 100644 --- a/libltdl/ltdl.c +++ b/libltdl/ltdl.c @@ -1348,15 +1348,27 @@ sys_wll_open (loader_data, filename) if (!searchname) return 0; -#if __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); + } + LT_DLFREE (searchname); /* libltdl expects this function to fail if it is unable