aboutsummaryrefslogtreecommitdiff
path: root/toys
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2015-03-12 15:32:50 -0500
committerRob Landley <rob@landley.net>2015-03-12 15:32:50 -0500
commitbbaa683b7d5fe0a77072f778050ba98e0a778b89 (patch)
treeae5cd7b876514f6eda16ad9d69889f6ac3ca61db /toys
parent9330bcb8ed38a27e1af87df9605527e369722632 (diff)
downloadtoybox-bbaa683b7d5fe0a77072f778050ba98e0a778b89.tar.gz
Implement shred -u and switch to default y in defconfig.
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);
}
}