Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2002-08-02 01:29:31 +0400
committerChristopher Faylor <me@cgf.cx>2002-08-02 01:29:31 +0400
commite51cfd3116d8535983953e744924f377c9c08825 (patch)
tree50e41a998ab67df3020739c48ac725e8e1797492 /winsup/cygwin
parent710c0fc4b70c88c32af58ec76b1592ca43fa134c (diff)
* syscalls.cc (link): Properly deal with a link to a symlink.
Diffstat (limited to 'winsup/cygwin')
-rw-r--r--winsup/cygwin/ChangeLog4
-rw-r--r--winsup/cygwin/syscalls.cc3
2 files changed, 7 insertions, 0 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index 43bcdf006..f5e8e1551 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,5 +1,9 @@
2002-08-01 Christopher Faylor <cgf@redhat.com>
+ * syscalls.cc (link): Properly deal with a link to a symlink.
+
+2002-08-01 Christopher Faylor <cgf@redhat.com>
+
* cygthread.cc: Remove cruft.
2002-08-01 Christopher Faylor <cgf@redhat.com>
diff --git a/winsup/cygwin/syscalls.cc b/winsup/cygwin/syscalls.cc
index 4b2fc3d07..84d080cf9 100644
--- a/winsup/cygwin/syscalls.cc
+++ b/winsup/cygwin/syscalls.cc
@@ -617,6 +617,7 @@ _link (const char *a, const char *b)
sigframe thisframe (mainthread);
path_conv real_b (b, PC_SYM_NOFOLLOW | PC_FULL);
path_conv real_a (a, PC_SYM_NOFOLLOW | PC_FULL);
+ extern BOOL allow_winsymlinks;
if (real_a.error)
{
@@ -647,6 +648,8 @@ _link (const char *a, const char *b)
/* Try to make hard link first on Windows NT */
if (wincap.has_hard_links ())
{
+ if (allow_winsymlinks && real_b.issymlink ())
+ strcat (real_a, ".lnk");
if (CreateHardLinkA (real_b, real_a, NULL))
{
res = 0;