From 1d6dc5c6b103648bf00949c8a7e659cec809bf0d Mon Sep 17 00:00:00 2001 From: adilger Date: Thu, 1 Aug 2002 00:01:18 +0000 Subject: [PATCH] Add munlink tool which unlinks files without stat first (unlike GNU rm). --- lustre/tests/Makefile.am | 4 +++- lustre/tests/munlink.c | 23 +++++++++++++++++++++++ lustre/tests/runtests | 2 +- 3 files changed, 27 insertions(+), 2 deletions(-) create mode 100755 lustre/tests/munlink.c diff --git a/lustre/tests/Makefile.am b/lustre/tests/Makefile.am index 39a89c1..0d9a9a5 100644 --- a/lustre/tests/Makefile.am +++ b/lustre/tests/Makefile.am @@ -23,13 +23,15 @@ noinst_SCRIPTS = fs.sh intent-test.sh intent-test2.sh leak_finder.pl \ runtests runvmstat snaprun.sh pkglib_SCRIPTS = common.sh pkgcfg_DATA = lustre.cfg -noinst_PROGRAMS = openunlink testreq truncate directio openme writeme mcreate tchmod toexcl fsx #ldaptest +noinst_PROGRAMS = openunlink testreq truncate directio openme writeme mcreate +noinst_PROGRAMS += munlink tchmod toexcl fsx #ldaptest # ldaptest_SOURCES = ldaptest.c tchmod_SOURCES = tchmod.c toexcl_SOURCES = toexcl.c testreq_SOURCES = testreq.c mcreate_SOURCES = mcreate.c +munlink_SOURCES = munlink.c truncate_SOURCES = truncate.c directio_SOURCES = directio.c openunlink_SOURCES = openunlink.c diff --git a/lustre/tests/munlink.c b/lustre/tests/munlink.c new file mode 100755 index 0000000..a3c18c5 --- /dev/null +++ b/lustre/tests/munlink.c @@ -0,0 +1,23 @@ +#include +#include +#include +#include +#include +#include +#include + +int main(int argc, char ** argv) +{ + int rc; + + if (argc < 2) { + printf("Usage %s filename\n", argv[0]); + return 1; + } + + rc = unlink(argv[1]); + if (rc) { + printf("unlink(%s) error: %s\n", argv[1], strerror(errno)); + } + return rc; +} diff --git a/lustre/tests/runtests b/lustre/tests/runtests index c999a4d..5f4dde4 100755 --- a/lustre/tests/runtests +++ b/lustre/tests/runtests @@ -12,7 +12,7 @@ export PATH=/sbin:/usr/sbin:$SRCDIR:$PATH ERROR= SRC=/etc -COUNT=1000 +[ "$COUNT" ] || COUNT=1000 setup_opts $@ -- 1.8.3.1