From bbaa683b7d5fe0a77072f778050ba98e0a778b89 Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Thu, 12 Mar 2015 15:32:50 -0500 Subject: Implement shred -u and switch to default y in defconfig. --- toys/other/shred.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'toys/other/shred.c') 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); } } -- cgit v1.2.3