diff options
author | Christopher Faylor <me@cgf.cx> | 2010-09-24 19:53:18 +0000 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2010-09-24 19:53:18 +0000 |
commit | 8d07b1aa2b58f286157e329be6f894a7f03d7490 (patch) | |
tree | 1ec9109babd62bdb0996c5de817ffb04f751cead /winsup/cygwin/autoload.cc | |
parent | 7438a10a019106738bbec980454a2da738d430ef (diff) | |
download | cygnal-8d07b1aa2b58f286157e329be6f894a7f03d7490.tar.gz cygnal-8d07b1aa2b58f286157e329be6f894a7f03d7490.tar.bz2 cygnal-8d07b1aa2b58f286157e329be6f894a7f03d7490.zip |
* autoload.cc (std_dll_init): Move dll_path closer to its use. Use dll_path in
fatal error. Set ret values under lock control.
* lib/minires.c (res_nsend): Fix compilation errors owing to pointer
signedness.
Diffstat (limited to 'winsup/cygwin/autoload.cc')
-rw-r--r-- | winsup/cygwin/autoload.cc | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/winsup/cygwin/autoload.cc b/winsup/cygwin/autoload.cc index 99fcf790e..4d8ffd08e 100644 --- a/winsup/cygwin/autoload.cc +++ b/winsup/cygwin/autoload.cc @@ -212,7 +212,6 @@ std_dll_init () struct func_info *func = (struct func_info *) __builtin_return_address (0); struct dll_info *dll = func->dll; retchain ret; - WCHAR dll_path[MAX_PATH]; if (InterlockedIncrement (&dll->here)) do @@ -225,6 +224,7 @@ std_dll_init () { fenv_t fpuenv; fegetenv (&fpuenv); + WCHAR dll_path[MAX_PATH]; /* http://www.microsoft.com/technet/security/advisory/2269637.mspx */ wcpcpy (wcpcpy (dll_path, windows_system_directory), dll->name); if ((h = LoadLibraryW (dll_path)) != NULL) @@ -233,11 +233,15 @@ std_dll_init () dll->handle = h; } else if (!(func->decoration & 1)) - api_fatal ("could not load %W, %E", dll->name); + api_fatal ("could not load %W, %E", dll_path); else dll->handle = INVALID_HANDLE_VALUE; } + /* Set "arguments for dll_chain. */ + ret.low = (long) dll->init; + ret.high = (long) func; + InterlockedDecrement (&dll->here); /* Kludge alert. Redirects the return address to dll_chain. */ @@ -245,9 +249,6 @@ std_dll_init () movl $dll_chain,4(%ebp) \n\ "); - /* Set "arguments for dll_chain. */ - ret.low = (long) dll->init; - ret.high = (long) func; return ret.ll; } |