From: Petr Štetiar Date: Thu, 30 May 2019 05:53:26 +0000 (+0200) Subject: container: fix .dockerenv stat check X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=ade00ca585a49c8478bf60eb24ce385676be37a4;p=oweals%2Fprocd.git container: fix .dockerenv stat check applied check wasn't evaluating the existence of the file properly. Fixes: 7f0f6b2a73f8 ("procd: add docker support") Signed-off-by: Petr Štetiar --- diff --git a/container.h b/container.h index dd2e432..903e3e8 100644 --- 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