Clean rootfs in switch_root

This commit is contained in:
topjohnwu
2020-04-01 23:37:11 -07:00
parent b28668e18d
commit dbfde74c1e
6 changed files with 27 additions and 35 deletions

View File

@ -478,7 +478,7 @@ static void collect_modules() {
fd_pathat(modfd, "uninstall.sh", buf, sizeof(buf));
if (access(buf, F_OK) == 0)
exec_script(buf);
frm_rf(modfd);
frm_rf(xdup(modfd));
unlinkat(dfd, entry->d_name, AT_REMOVEDIR);
continue;
}