Use setmntent with "e" option
Otherwise it will cause selinux warning in children processes sometimes Change-Id: I41239c3f9779140622076c644a5f63051d00eaa8
This commit is contained in:
parent
2a683d4ce6
commit
4f04606811
2 changed files with 2 additions and 2 deletions
|
@ -766,7 +766,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;
|
||||
|
|
|
@ -589,7 +589,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…
Reference in a new issue