cryptohome: add a underscore for member variable
Add a underscore to the "exists" variable in MountNamespace
BUG=None
TEST=FEATURES=test emerge-soraka cryptohome
Change-Id: I1fef4a8edf50c2c98bceb6bfc2bfd0e118eccb4f
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform2/+/2340300
Tested-by: joe Chou <yich@google.com>
Reviewed-by: Jorge Lucangeli Obes <jorgelo@chromium.org>
Commit-Queue: Jorge Lucangeli Obes <jorgelo@chromium.org>
diff --git a/cryptohome/mount_namespace.cc b/cryptohome/mount_namespace.cc
index dae201a..6b9261c 100644
--- a/cryptohome/mount_namespace.cc
+++ b/cryptohome/mount_namespace.cc
@@ -14,13 +14,13 @@
namespace cryptohome {
MountNamespace::~MountNamespace() {
- if (exists) {
+ if (exists_) {
Destroy();
}
}
bool MountNamespace::Create() {
- if (exists) {
+ if (exists_) {
LOG(ERROR) << "Non-root mount namespace at " << ns_path_.value()
<< " already exists, cannot create";
return false;
@@ -41,12 +41,12 @@
LOG(ERROR) << "Failed to run 'unshare " << mount
<< "--propagation=unchanged -- /bin/true'";
}
- exists = rc == 0;
- return exists;
+ exists_ = rc == 0;
+ return exists_;
}
bool MountNamespace::Destroy() {
- if (!exists) {
+ if (!exists_) {
LOG(ERROR) << "Non-root mount namespace at " << ns_path_.value()
<< " does not exist, cannot destroy";
return false;
@@ -59,13 +59,13 @@
if (was_busy) {
LOG(ERROR) << ns_path_.value() << " was busy";
}
- // If Unmount() fails, keep the object valid by keeping |exists| set to
+ // If Unmount() fails, keep the object valid by keeping |exists_| set to
// true.
return false;
} else {
VLOG(1) << "Unmounted namespace at " << ns_path_.value();
}
- exists = false;
+ exists_ = false;
return true;
}
diff --git a/cryptohome/mount_namespace.h b/cryptohome/mount_namespace.h
index ee19084..16f6c7b 100644
--- a/cryptohome/mount_namespace.h
+++ b/cryptohome/mount_namespace.h
@@ -22,7 +22,7 @@
// destroyed when the object goes out of scope.
public:
MountNamespace(const base::FilePath& ns_path, Platform* platform)
- : ns_path_(ns_path), exists(false), platform_(platform) {}
+ : ns_path_(ns_path), exists_(false), platform_(platform) {}
~MountNamespace();
base::FilePath path() const { return ns_path_; }
@@ -32,7 +32,7 @@
private:
base::FilePath ns_path_;
- bool exists;
+ bool exists_;
Platform* platform_;
DISALLOW_COPY_AND_ASSIGN(MountNamespace);