sbase

suckless unix tools
git clone git://git.2f30.org/sbase
Log | Files | Refs | README | LICENSE

commit ac47a21b9bf6d865f1165f376fa2bcb694eb9bf4
parent 43b472601dc0ccefac66cabaf564ce85d6014762
Author: sin <sin@2f30.org>
Date:   Fri, 14 Feb 2014 11:23:07 +0000

Don't complain if we use -f in ln(1)

Diffstat:
Mln.c | 8+++-----
1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/ln.c b/ln.c @@ -41,13 +41,11 @@ ln(const char *s1, const char *s2) { int (*flink)(const char *, const char *) = sflag ? symlink : link; + if (fflag) + if (remove(s2) == -1) + eprintf("remove %s:", s2); if(flink(s1, s2) == 0) return 0; - if(fflag && errno == EEXIST) { - if(remove(s2) == -1) - eprintf("remove %s:", s2); - return flink(s1, s2); - } return -1; }