Merge "Use setmntent with "e" option" am: 396040ca2c am: a92bdeb7f5

am: 2255cf528f

Change-Id: Ibc84f3b9d2dc8ab0707b354d64529434355f36d6
gugelfrei
LongPing.WEI 6 years ago committed by android-build-merger
commit 60f121b389

@ -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;

@ -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;

Loading…
Cancel
Save