Don't complain if we use -f in ln(1)
This commit is contained in:
parent
43b472601d
commit
ac47a21b9b
8
ln.c
8
ln.c
|
@ -41,13 +41,11 @@ ln(const char *s1, const char *s2)
|
||||||
{
|
{
|
||||||
int (*flink)(const char *, const char *) = sflag ? symlink : link;
|
int (*flink)(const char *, const char *) = sflag ? symlink : link;
|
||||||
|
|
||||||
if(flink(s1, s2) == 0)
|
if (fflag)
|
||||||
return 0;
|
|
||||||
if(fflag && errno == EEXIST) {
|
|
||||||
if (remove(s2) == -1)
|
if (remove(s2) == -1)
|
||||||
eprintf("remove %s:", s2);
|
eprintf("remove %s:", s2);
|
||||||
return flink(s1, s2);
|
if(flink(s1, s2) == 0)
|
||||||
}
|
return 0;
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user