tree-wide: make use of getpid_cached() wherever we can
This moves pretty much all uses of getpid() over to getpid_raw(). I didn't specifically check whether the optimization is worth it for each replacement, but in order to keep things simple and systematic I switched over everything at once.
This commit is contained in:
+1
-1
@@ -422,7 +422,7 @@ int detect_container(void) {
|
||||
goto finish;
|
||||
}
|
||||
|
||||
if (getpid() == 1) {
|
||||
if (getpid_cached() == 1) {
|
||||
/* If we are PID 1 we can just check our own environment variable, and that's authoritative. */
|
||||
|
||||
e = getenv("container");
|
||||
|
||||
Reference in New Issue
Block a user