summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/fhandler_disk_file.cc
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2009-10-12 11:57:29 +0000
committerCorinna Vinschen <corinna@vinschen.de>2009-10-12 11:57:29 +0000
commitd358c9e9b084d4154a1cf994abfe9b9d09597b3d (patch)
tree8211ddf92fb0715a5fbbc2fe675cc96d7872a069 /winsup/cygwin/fhandler_disk_file.cc
parent2072888e66f0859bd7a0f77a5b24db4d3bdc6c34 (diff)
downloadcygnal-d358c9e9b084d4154a1cf994abfe9b9d09597b3d.tar.gz
cygnal-d358c9e9b084d4154a1cf994abfe9b9d09597b3d.tar.bz2
cygnal-d358c9e9b084d4154a1cf994abfe9b9d09597b3d.zip
* fhandler_disk_file.cc (fhandler_disk_file::link): Only append .lnk
if the original device had one, too. Add comment. * fhandler_socket.cc (fhandler_socket::fstat): Always return a size of 0 on sockets.
Diffstat (limited to 'winsup/cygwin/fhandler_disk_file.cc')
-rw-r--r--winsup/cygwin/fhandler_disk_file.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/winsup/cygwin/fhandler_disk_file.cc b/winsup/cygwin/fhandler_disk_file.cc
index 1e6a781e0..eaf065f1e 100644
--- a/winsup/cygwin/fhandler_disk_file.cc
+++ b/winsup/cygwin/fhandler_disk_file.cc
@@ -1210,7 +1210,12 @@ fhandler_disk_file::link (const char *newpath)
char new_buf[nlen + 5];
if (!newpc.error)
{
- if (pc.is_lnk_special ())
+ /* If the original file is a lnk special file (except for sockets),
+ and if the original file has a .lnk suffix, add one to the hardlink
+ as well. */
+ if (pc.is_lnk_special () && !pc.issocket ()
+ && RtlEqualUnicodePathSuffix (pc.get_nt_native_path (),
+ &ro_u_lnk, TRUE))
{
/* Shortcut hack. */
stpcpy (stpcpy (new_buf, newpath), ".lnk");