From 5d50ef62504364cdd8c679b8c573225373f36cdc Mon Sep 17 00:00:00 2001 From: JongHeon Choi Date: Wed, 22 Jun 2016 13:36:21 +0900 Subject: [PATCH] To reduce launching time, use syncfs instead of sync --- runtime/browser/prelauncher.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/runtime/browser/prelauncher.cc b/runtime/browser/prelauncher.cc index e7a2f46..2f64fbb 100755 --- a/runtime/browser/prelauncher.cc +++ b/runtime/browser/prelauncher.cc @@ -43,8 +43,10 @@ int SmackLabelSetForTask(const std::string& label) { snprintf(path, sizeof(path), "/proc/%d/attr/current", tid); fd = open(path, O_WRONLY); if (fd < 0) - return -1; + return -1; ret = write(fd, label.c_str(), label.length()); + if (syncfs(fd) < 0) + return -1; close(fd); return (ret < 0) ? -1 : 0; } @@ -71,7 +73,6 @@ void ChangePrivilegeForThreads(const std::string& appid) { continue; syscall(__NR_tkill, tid, SIGUSR1); } - sync(); closedir(dir); } signal(SIGUSR1, oldhandler); -- 2.7.4