mirror of
git://sourceware.org/git/newlib-cygwin.git
synced 2025-03-03 13:35:46 +08:00
Cygwin: syscalls.cc: remove ".dll" from blessed_executable_suffixes
This reverts commit d9e9c7b5a7. The latter added ".dll" to the blessed_executable_suffixes array because on 32-bit Windows, the GetBinaryType function would report that a 64-bit DLL is an executable, contrary to the documentation of that function. That anomaly does not exist on 64-bit Windows, so we can remove ".dll" from the list. Reverting the commit does, however, change the behavior of the rename(2) syscall in the following unlikely situation: Suppose we have an executable foo.exe and we make the call rename ("foo", "bar.dll"); Previously, foo.exe would be renamed to bar.dll. So bar.dll would then be an executable without the .exe extension. The new behavior is that foo.exe will be renamed to bar.dll.exe. [Exception: If there already existed an executable (not a DLL!) with the name bar.dll, then .exe will not be appended.]
This commit is contained in:
parent
288788f91e
commit
c2aa5b6d74
@ -120,7 +120,6 @@ const int __collate_load_error = 0;
|
||||
extern UNICODE_STRING _RDATA ro_u_empty = _ROU (L"");
|
||||
extern UNICODE_STRING _RDATA ro_u_lnk = _ROU (L".lnk");
|
||||
extern UNICODE_STRING _RDATA ro_u_exe = _ROU (L".exe");
|
||||
extern UNICODE_STRING _RDATA ro_u_dll = _ROU (L".dll");
|
||||
extern UNICODE_STRING _RDATA ro_u_com = _ROU (L".com");
|
||||
extern UNICODE_STRING _RDATA ro_u_scr = _ROU (L".scr");
|
||||
extern UNICODE_STRING _RDATA ro_u_sys = _ROU (L".sys");
|
||||
|
@ -2098,12 +2098,6 @@ nt_path_has_executable_suffix (PUNICODE_STRING upath)
|
||||
static const PUNICODE_STRING blessed_executable_suffixes[] =
|
||||
{
|
||||
&ro_u_com,
|
||||
&ro_u_dll, /* Messy, messy. Per MSDN, the GetBinaryType function is
|
||||
supposed to return with ERROR_BAD_EXE_FORMAT. if the file
|
||||
is a DLL. On 64-bit Windows, this works as expected for
|
||||
32-bit and 64-bit DLLs. On 32-bit Windows this only works
|
||||
for 32-bit DLLs. For 64-bit DLLs, 32-bit Windows returns
|
||||
true with the type set to SCS_64BIT_BINARY. */
|
||||
&ro_u_exe,
|
||||
&ro_u_scr,
|
||||
&ro_u_sys,
|
||||
|
Loading…
x
Reference in New Issue
Block a user