aboutsummaryrefslogtreecommitdiffstats
path: root/src/cmd-instance.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/cmd-instance.c')
-rw-r--r--src/cmd-instance.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/src/cmd-instance.c b/src/cmd-instance.c
index 7a569e8..a09bffa 100644
--- a/src/cmd-instance.c
+++ b/src/cmd-instance.c
@@ -232,16 +232,8 @@ unsigned cmd_instance_remove(struct l2_context_node *ctx, char **args)
/* delete the thing if it is necessary */
if (flag_remove) {
- res = nftw(removepath, &cmd__delete_with_reckless_abandon, 128, FTW_DEPTH | FTW_PHYS);
- switch (res) {
- case -2:
- CMD_FATAL0(CMD_MSG_INSTANCE_DELDIR_ERR("unreadable file/folder encountered"));
- case -1:
- CMD_FATAL0(CMD_MSG_INSTANCE_DELDIR_ERR("error walking file tree"));
- case 0:
- break;
- default:
- CMD_FATAL(CMD_MSG_INSTANCE_DELDIR_ERR("error removing a file: %s"), strerror(res));
+ if (l2_launcher_rm_tree(removepath, 0) < 0) {
+ CMD_FATAL0("Could not delete instance directory.");
}
}