* syscalls.cc (link): Properly deal with a link to a symlink.
This commit is contained in:
parent
710c0fc4b7
commit
e51cfd3116
|
@ -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>
|
2002-08-01 Christopher Faylor <cgf@redhat.com>
|
||||||
|
|
||||||
* cygthread.cc: Remove cruft.
|
* cygthread.cc: Remove cruft.
|
||||||
|
|
|
@ -617,6 +617,7 @@ _link (const char *a, const char *b)
|
||||||
sigframe thisframe (mainthread);
|
sigframe thisframe (mainthread);
|
||||||
path_conv real_b (b, PC_SYM_NOFOLLOW | PC_FULL);
|
path_conv real_b (b, PC_SYM_NOFOLLOW | PC_FULL);
|
||||||
path_conv real_a (a, PC_SYM_NOFOLLOW | PC_FULL);
|
path_conv real_a (a, PC_SYM_NOFOLLOW | PC_FULL);
|
||||||
|
extern BOOL allow_winsymlinks;
|
||||||
|
|
||||||
if (real_a.error)
|
if (real_a.error)
|
||||||
{
|
{
|
||||||
|
@ -647,6 +648,8 @@ _link (const char *a, const char *b)
|
||||||
/* Try to make hard link first on Windows NT */
|
/* Try to make hard link first on Windows NT */
|
||||||
if (wincap.has_hard_links ())
|
if (wincap.has_hard_links ())
|
||||||
{
|
{
|
||||||
|
if (allow_winsymlinks && real_b.issymlink ())
|
||||||
|
strcat (real_a, ".lnk");
|
||||||
if (CreateHardLinkA (real_b, real_a, NULL))
|
if (CreateHardLinkA (real_b, real_a, NULL))
|
||||||
{
|
{
|
||||||
res = 0;
|
res = 0;
|
||||||
|
|
Loading…
Reference in New Issue