if (!h->container_full_path)
continue;
- ret = recursive_destroy(h->container_full_path);
+ ret = lxc_rm_rf(h->container_full_path);
if (ret < 0)
WARN("Failed to destroy \"%s\"", h->container_full_path);
/* Monitor might have died before we entered the cgroup. */
if (handler->monitor_pid <= 0) {
WARN("No valid monitor process found while destroying cgroups");
- goto try_recursive_destroy;
+ goto try_lxc_rm_rf;
}
if (conf && conf->cgroup_meta.dir)
ret = mkdir_p(pivot_path, 0755);
if (ret < 0 && errno != EEXIST) {
ERROR("Failed to create %s", pivot_path);
- goto try_recursive_destroy;
+ goto try_lxc_rm_rf;
}
ret = lxc_write_openat(pivot_path, "cgroup.procs", pidstr, len);
continue;
}
-try_recursive_destroy:
- ret = recursive_destroy(h->monitor_full_path);
+try_lxc_rm_rf:
+ ret = lxc_rm_rf(h->monitor_full_path);
if (ret < 0)
WARN("Failed to destroy \"%s\"", h->monitor_full_path);
}
return true;
}
-static int btrfs_recursive_destroy(const char *path)
+static int btrfs_lxc_rm_rf(const char *path)
{
u64 root_id;
int fd;
if (!btrfs_detect(path))
return false;
- return btrfs_recursive_destroy(path) == 0;
+ return btrfs_lxc_rm_rf(path) == 0;
}
int btrfs_destroy(struct lxc_storage *orig)
src = lxc_storage_get_path(orig->src, "btrfs");
- return btrfs_recursive_destroy(src);
+ return btrfs_lxc_rm_rf(src);
}
int btrfs_create(struct lxc_storage *bdev, const char *dest, const char *n,
if (check < 0 || (size_t)check >= *len_lockpath)
goto out;
- ret = recursive_destroy(*lockpath);
+ ret = lxc_rm_rf(*lockpath);
if (ret < 0)
WARN("Failed to destroy \"%s\"", *lockpath);
return 0;
}
-int recursive_destroy(const char *dirname)
+int lxc_rm_rf(const char *dirname)
{
__do_closedir DIR *dir = NULL;
int fret = 0;
if (!S_ISDIR(mystat.st_mode))
continue;
- ret = recursive_destroy(pathname);
+ ret = lxc_rm_rf(pathname);
if (ret < 0)
fret = -1;
}
/* Set a signal the child process will receive after the parent has died. */
extern int lxc_set_death_signal(int signal, pid_t parent, int parent_status_fd);
extern int fd_cloexec(int fd, bool cloexec);
-extern int recursive_destroy(const char *dirname);
+extern int lxc_rm_rf(const char *dirname);
extern int lxc_setup_keyring(char *keyring_label);
extern bool lxc_can_use_pidfd(int pidfd);
static void lxc_teardown_shmount(char *shmount_path)
{
(void)umount2(shmount_path, MNT_DETACH);
- (void)recursive_destroy(shmount_path);
+ (void)lxc_rm_rf(shmount_path);
}
int main(int argc, char *argv[])