summaryrefslogtreecommitdiff
path: root/src/test/test-copy.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2015-04-04 11:52:57 +0200
committerLennart Poettering <lennart@poettering.net>2015-04-06 10:57:53 +0200
commitc6878637502b1717a110a9a7e8bba32a8583fcdf (patch)
tree44bd9f305f8f3b97a0c736c3ac549e568b6495cd /src/test/test-copy.c
parent2f653bded321fc2271edcda43d54fcc3e6c20dc9 (diff)
util: rework rm_rf() logic
- Move to its own file rm-rf.c - Change parameters into a single flags parameter - Remove "honour sticky" logic, it's unused these days
Diffstat (limited to 'src/test/test-copy.c')
-rw-r--r--src/test/test-copy.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/test/test-copy.c b/src/test/test-copy.c
index 5c96f61005..403d85bff0 100644
--- a/src/test/test-copy.c
+++ b/src/test/test-copy.c
@@ -26,6 +26,7 @@
#include "strv.h"
#include "macro.h"
#include "util.h"
+#include "rm-rf.h"
static void test_copy_file(void) {
_cleanup_free_ char *buf = NULL;
@@ -86,8 +87,8 @@ static void test_copy_tree(void) {
"link2", "dir1/file");
char **p, **link;
- rm_rf_dangerous(copy_dir, false, true, false);
- rm_rf_dangerous(original_dir, false, true, false);
+ (void) rm_rf(copy_dir, REMOVE_ROOT|REMOVE_PHYSICAL);
+ (void) rm_rf(original_dir, REMOVE_ROOT|REMOVE_PHYSICAL);
STRV_FOREACH(p, files) {
char *f = strjoina(original_dir, *p);
@@ -128,8 +129,8 @@ static void test_copy_tree(void) {
assert_se(copy_tree(original_dir, copy_dir, false) < 0);
assert_se(copy_tree("/tmp/inexistent/foo/bar/fsdoi", copy_dir, false) < 0);
- rm_rf_dangerous(copy_dir, false, true, false);
- rm_rf_dangerous(original_dir, false, true, false);
+ (void) rm_rf(copy_dir, REMOVE_ROOT|REMOVE_PHYSICAL);
+ (void) rm_rf(original_dir, REMOVE_ROOT|REMOVE_PHYSICAL);
}
int main(int argc, char *argv[]) {