cgroups: restrict allowed keys in 'unified' section
[project/procd.git] / container.h
index dd2e432adbfc586fd824846d63485b42248fe8a9..903e3e809627170b852c1f9fe541df3087005018 100644 (file)
@@ -20,7 +20,8 @@
 
 static inline bool is_container() {
        struct stat s;
-       return !!getenv("container") || !!stat("/.dockerenv", &s);
+       int r = stat("/.dockerenv", &s);
+       return !!getenv("container") || r == 0;
 }
 
 #endif