[PATCH] Cygwin: syscalls.cc: remove ".dll" from, blessed_executable_suffixes

Corinna Vinschen corinna-cygwin@cygwin.com
Thu Aug 4 18:37:24 GMT 2022


On Aug  4 08:00, Ken Brown wrote:
> Patch attached.  I'm not 100% sure of this since it does change behavior
> (but in a weird case).
> 
> Ken

> From 97a2fc0d07c8f9045b73716ac5a05f972d5bd75c Mon Sep 17 00:00:00 2001
> From: Ken Brown <kbrown@cornell.edu>
> Date: Wed, 3 Aug 2022 16:45:23 -0400
> Subject: [PATCH] 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.]
> ---
>  winsup/cygwin/globals.cc  | 1 -
>  winsup/cygwin/syscalls.cc | 6 ------
>  2 files changed, 7 deletions(-)

LGTM.


Thanks,
Corinna


More information about the Cygwin-patches mailing list