ln: Only fail if same inode without -f flag

This commit is contained in:
Michael Forney 2016-07-08 10:24:10 -07:00 committed by sin
parent 083d1451ac
commit a211649cfd
1 changed files with 5 additions and 3 deletions

8
ln.c
View File

@ -77,9 +77,11 @@ main(int argc, char *argv[])
continue; continue;
} }
} else if (st.st_dev == tst.st_dev && st.st_ino == tst.st_ino) { } else if (st.st_dev == tst.st_dev && st.st_ino == tst.st_ino) {
weprintf("%s and %s/%s are the same file\n", if (!fflag) {
*argv, targetdir, target); weprintf("%s and %s/%s are the same file\n",
ret = 1; *argv, targetdir, target);
ret = 1;
}
continue; continue;
} }
} }