aboutsummaryrefslogtreecommitdiff
path: root/toys
diff options
context:
space:
mode:
Diffstat (limited to 'toys')
-rw-r--r--toys/other/shred.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/toys/other/shred.c b/toys/other/shred.c
index 07d62c3d..64db5edf 100644
--- a/toys/other/shred.c
+++ b/toys/other/shred.c
@@ -8,7 +8,7 @@ USE_SHRED(NEWTOY(shred, "<1zxus#<1n#<1o#<0f", TOYFLAG_USR|TOYFLAG_BIN))
config SHRED
bool "shred"
- default n
+ default y
help
usage: shred [-fuz] [-n COUNT] [-s SIZE] FILE...
@@ -100,5 +100,7 @@ void shred_main(void)
if (throw != writeall(fd, toybuf, throw)) perror_msg("%s");
pos += throw;
}
+ if (toys.optflags & FLAG_u)
+ if (unlink(*try)) perror_msg("unlink '%s'", *try);
}
}