projects
/
project
/
procd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
instance: make sure values are not inherited from previous runs
[project/procd.git]
/
container.h
diff --git
a/container.h
b/container.h
index d33fa3266dc09e627ace4f8397796ad018d853b2..903e3e809627170b852c1f9fe541df3087005018 100644
(file)
--- a/
container.h
+++ b/
container.h
@@
-16,9
+16,12
@@
#include <stdlib.h>
#include <stdbool.h>
+#include <sys/stat.h>
static inline bool is_container() {
- return !!getenv("container");
+ struct stat s;
+ int r = stat("/.dockerenv", &s);
+ return !!getenv("container") || r == 0;
}
#endif