summaryrefslogtreecommitdiffstats
path: root/Utils.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Utils.cpp')
-rw-r--r--Utils.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/Utils.cpp b/Utils.cpp
index 2ccd45f..ec9c906 100644
--- a/Utils.cpp
+++ b/Utils.cpp
@@ -522,5 +522,15 @@ std::string BuildKeyPath(const std::string& partGuid) {
return StringPrintf("%s/expand_%s.key", kKeyPath, partGuid.c_str());
}
+dev_t GetDevice(const std::string& path) {
+ struct stat sb;
+ if (stat(path.c_str(), &sb)) {
+ PLOG(WARNING) << "Failed to stat " << path;
+ return 0;
+ } else {
+ return sb.st_dev;
+ }
+}
+
} // namespace vold
} // namespace android