Cygwin: socket files are not lnk special files
Change path_conv::is_lnk_special() so that it returns false on socket files. is_lnk_special() is called by rename2() in order to deal with special files (FIFOs and symlinks, for example) whose Win32 names usually have a ".lnk" suffix. Socket files do not fall into this category, and this change prevents ".lnk" from being appended erroneously when such files are renamed. Remove a now redundant !pc.issocket() from fhandler_disk_file::link().
This commit is contained in:
@ -1190,10 +1190,10 @@ fhandler_disk_file::link (const char *newpath)
|
||||
char new_buf[nlen + 5];
|
||||
if (!newpc.error)
|
||||
{
|
||||
/* If the original file is a lnk special file (except for sockets),
|
||||
/* If the original file is a lnk special file,
|
||||
and if the original file has a .lnk suffix, add one to the hardlink
|
||||
as well. */
|
||||
if (pc.is_lnk_special () && !pc.issocket ()
|
||||
if (pc.is_lnk_special ()
|
||||
&& RtlEqualUnicodePathSuffix (pc.get_nt_native_path (),
|
||||
&ro_u_lnk, TRUE))
|
||||
{
|
||||
|
Reference in New Issue
Block a user