Skip to content

Commit 7051ed4

Browse files
committed
Use anonymous namespace.
1 parent b8ff44f commit 7051ed4

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

base/cvd/cuttlefish/common/libs/utils/container.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,16 @@
2222
#include "cuttlefish/common/libs/utils/files.h"
2323

2424
namespace cuttlefish {
25+
namespace {
2526

26-
static bool IsRunningInDocker() {
27+
bool IsRunningInDocker() {
2728
// if /.dockerenv exists, it's inside a docker container
28-
static std::string docker_env_path("/.dockerenv");
29-
static bool ret =
30-
FileExists(docker_env_path) || DirectoryExists(docker_env_path);
31-
return ret;
29+
std::string docker_env_path("/.dockerenv");
30+
return FileExists(docker_env_path) || DirectoryExists(docker_env_path);
3231
}
3332

33+
} // namespace
34+
3435
bool IsRunningInContainer() {
3536
// TODO: add more if we support other containers than docker
3637
return IsRunningInDocker();

0 commit comments

Comments
 (0)