]> sourceware.org Git - newlib-cygwin.git/commitdiff
* syscalls.cc (link): Properly deal with a link to a symlink.
authorChristopher Faylor <me@cgf.cx>
Thu, 1 Aug 2002 21:29:31 +0000 (21:29 +0000)
committerChristopher Faylor <me@cgf.cx>
Thu, 1 Aug 2002 21:29:31 +0000 (21:29 +0000)
winsup/cygwin/ChangeLog
winsup/cygwin/syscalls.cc

index 43bcdf0060c501d0e1fe45a658eeefef4a0ad73b..f5e8e1551cad32dd0e117178594121f117022fd0 100644 (file)
@@ -1,3 +1,7 @@
+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.
index 4b2fc3d0738d3189ffeefebbc35c50fc8b183122..84d080cf9ac4b104e97987e115903d6631d61aef 100644 (file)
@@ -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;
This page took 0.03655 seconds and 5 git commands to generate.