virt: Use cache for VIRTUALIZATION_PROOT

Of course, the very moment after I merged #15426, I noticed something
was off: everything works, but the cache isn't updated. 🙈
This commit is contained in:
Chris Down 2020-04-15 18:40:14 +01:00 committed by Zbigniew Jędrzejewski-Szmek
parent 67551eac30
commit 9b4f3fa3ea

View file

@ -485,8 +485,10 @@ int detect_container(void) {
const char *pf = procfs_file_alloca(ptrace_pid, "comm");
_cleanup_free_ char *ptrace_comm = NULL;
r = read_one_line_file(pf, &ptrace_comm);
if (r >= 0 && startswith(ptrace_comm, "proot"))
return VIRTUALIZATION_PROOT;
if (r >= 0 && startswith(ptrace_comm, "proot")) {
r = VIRTUALIZATION_PROOT;
goto finish;
}
}
}