Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 1 addition & 15 deletions systemdhook.c
Original file line number Diff line number Diff line change
Expand Up @@ -230,28 +230,14 @@ int poststop(const char *rootfs,
}

int ret = 0;
char run_id_path[PATH_MAX];
snprintf(run_id_path, PATH_MAX, "/run/%s/", id);
char etc_dir_path[PATH_MAX];
snprintf(etc_dir_path, PATH_MAX, "/run/%s/etc", id);
char mid_path[PATH_MAX];
snprintf(mid_path, PATH_MAX, "/run/%s/etc/machine-id", id);
snprintf(mid_path, PATH_MAX, "%s/etc/machine-id", rootfs);

if (unlink(mid_path) != 0 && (errno != ENOENT)) {
pr_perror("Unable to remove %s", mid_path);
ret = 1;
}

if ((rmdir(etc_dir_path) != 0) && (errno != ENOENT)) {
pr_perror("Unable to remove %s", etc_dir_path);
ret = 1;
}

if ((rmdir(run_id_path) != 0) && (errno != ENOENT)) {
pr_perror("Unable to remove %s", run_id_path);
ret = 1;
}

return ret;
}

Expand Down