commit | 4f046068117ee17f6e0e25cef785f00db2e856f8 | [log] [tgz] |
---|---|---|
author | LongPing.WEI <weilongping@huawei.com> | Fri Nov 23 19:27:35 2018 +0800 |
committer | LongPing.WEI <weilongping@huawei.com> | Fri Nov 23 19:27:35 2018 +0800 |
tree | 46959c8a24ba16ae1dc0b9bc4893771727215e65 | |
parent | 2a683d4ce690ffdc1c5eaffee7709231d6845322 [diff] [blame] |
Use setmntent with "e" option Otherwise it will cause selinux warning in children processes sometimes Change-Id: I41239c3f9779140622076c644a5f63051d00eaa8
diff --git a/Utils.cpp b/Utils.cpp index 04c3956..ce1f777 100644 --- a/Utils.cpp +++ b/Utils.cpp
@@ -766,7 +766,7 @@ } 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;