projects
/
oweals
/
procd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
385b904
)
container: fix .dockerenv stat check
author
Petr Štetiar
<ynezz@true.cz>
Thu, 30 May 2019 05:53:26 +0000
(07:53 +0200)
committer
Petr Štetiar
<ynezz@true.cz>
Thu, 30 May 2019 05:53:26 +0000
(07:53 +0200)
applied check wasn't evaluating the existence of the file properly.
Fixes:
7f0f6b2a73f8
("procd: add docker support")
Signed-off-by: Petr Štetiar <ynezz@true.cz>
container.h
patch
|
blob
|
history
diff --git
a/container.h
b/container.h
index dd2e432adbfc586fd824846d63485b42248fe8a9..903e3e809627170b852c1f9fe541df3087005018 100644
(file)
--- a/
container.h
+++ b/
container.h
@@
-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