diff --git a/Utils.cpp b/Utils.cpp index f7afde5..57417d6 100644 --- a/Utils.cpp +++ b/Utils.cpp @@ -767,7 +767,7 @@ bool IsRunningInEmulator() { } status_t UnmountTree(const std::string& prefix) { - FILE* fp = setmntent("/proc/mounts", "r"); + FILE* fp = setmntent("/proc/mounts", "re"); if (fp == NULL) { PLOG(ERROR) << "Failed to open /proc/mounts"; return -errno; diff --git a/VolumeManager.cpp b/VolumeManager.cpp index f3604ee..aeab4f8 100644 --- a/VolumeManager.cpp +++ b/VolumeManager.cpp @@ -1221,7 +1221,7 @@ int VolumeManager::unmountAll() { // Worst case we might have some stale mounts lurking around, so // force unmount those just to be safe. - FILE* fp = setmntent("/proc/mounts", "r"); + FILE* fp = setmntent("/proc/mounts", "re"); if (fp == NULL) { PLOG(ERROR) << "Failed to open /proc/mounts"; return -errno;