mirror of
https://github.com/sheumann/hush.git
synced 2024-10-31 19:04:47 +00:00
af3f420116
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
34 lines
820 B
C
34 lines
820 B
C
/* vi: set sw=4 ts=4: */
|
|
/* unlink for busybox
|
|
*
|
|
* Copyright (C) 2014 Isaac Dunham <ibid.ag@gmail.com>
|
|
*
|
|
* Licensed under GPLv2, see LICENSE in this source tree
|
|
*/
|
|
//config:config UNLINK
|
|
//config: bool "unlink"
|
|
//config: default y
|
|
//config: help
|
|
//config: unlink deletes a file by calling unlink()
|
|
|
|
//applet:IF_UNLINK(APPLET(unlink, BB_DIR_USR_BIN, BB_SUID_DROP))
|
|
|
|
//kbuild:lib-$(CONFIG_UNLINK) += unlink.o
|
|
|
|
//usage:#define unlink_trivial_usage
|
|
//usage: "FILE"
|
|
//usage:#define unlink_full_usage "\n\n"
|
|
//usage: "Delete FILE by calling unlink()"
|
|
|
|
#include "libbb.h"
|
|
|
|
int unlink_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
|
|
int unlink_main(int argc UNUSED_PARAM, char **argv)
|
|
{
|
|
opt_complementary = "=1"; /* must have exactly 1 param */
|
|
getopt32(argv, "");
|
|
argv += optind;
|
|
xunlink(argv[0]);
|
|
return 0;
|
|
}
|