summaryrefslogtreecommitdiffstats
path: root/bin/rm/rm.c
diff options
context:
space:
mode:
Diffstat (limited to 'bin/rm/rm.c')
-rw-r--r--bin/rm/rm.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/bin/rm/rm.c b/bin/rm/rm.c
index c311b6e..25a984e 100644
--- a/bin/rm/rm.c
+++ b/bin/rm/rm.c
@@ -400,10 +400,10 @@ rm_overwrite(char *file, struct stat *sbp)
}
if (!S_ISREG(sbp->st_mode))
return (1);
- if (sbp->st_nlink > 1) {
+ if (sbp->st_nlink > 1 && !fflag) {
warnx("%s (inode %u): not overwritten due to multiple links",
file, sbp->st_ino);
- return (1);
+ return (0);
}
if ((fd = open(file, O_WRONLY, 0)) == -1)
goto err;
OpenPOWER on IntegriCloud