• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
Keine Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

system/core


Commit MetaInfo

Revision83e9f6bd6882583d726661309bfe6ea77d43ac6c (tree)
Zeit2019-05-14 09:25:22
AutorTreeHugger Robot <treehugger-gerrit@goog...>
CommiterAndroid (Google) Code Review

Log Message

Merge "fs_mgr: overlayfs: ReadFstabFromFile touches errno" into qt-dev

Ändern Zusammenfassung

Diff

--- a/fs_mgr/fs_mgr_fstab.cpp
+++ b/fs_mgr/fs_mgr_fstab.cpp
@@ -704,7 +704,9 @@ bool SkipMountingPartitions(Fstab* fstab) {
704704 constexpr const char kSkipMountConfig[] = "/system/etc/init/config/skip_mount.cfg";
705705
706706 std::string skip_config;
707+ auto save_errno = errno;
707708 if (!ReadFileToString(kSkipMountConfig, &skip_config)) {
709+ errno = save_errno; // missing file is expected
708710 return true;
709711 }
710712
--- a/fs_mgr/fs_mgr_overlayfs.cpp
+++ b/fs_mgr/fs_mgr_overlayfs.cpp
@@ -139,7 +139,11 @@ bool fs_mgr_filesystem_has_space(const std::string& mount_point) {
139139 // If we have access issues to find out space remaining, return true
140140 // to prevent us trying to override with overlayfs.
141141 struct statvfs vst;
142- if (statvfs(mount_point.c_str(), &vst)) return true;
142+ auto save_errno = errno;
143+ if (statvfs(mount_point.c_str(), &vst)) {
144+ errno = save_errno;
145+ return true;
146+ }
143147
144148 static constexpr int kPercentThreshold = 1; // 1%
145149
@@ -265,9 +269,11 @@ bool fs_mgr_rw_access(const std::string& path) {
265269
266270 bool fs_mgr_overlayfs_already_mounted(const std::string& mount_point, bool overlay_only = true) {
267271 Fstab fstab;
272+ auto save_errno = errno;
268273 if (!ReadFstabFromFile("/proc/mounts", &fstab)) {
269274 return false;
270275 }
276+ errno = save_errno;
271277 const auto lowerdir = kLowerdirOption + mount_point;
272278 for (const auto& entry : fstab) {
273279 if (overlay_only && "overlay" != entry.fs_type && "overlayfs" != entry.fs_type) continue;