Change the file location for update_engine log am: 1e2750ac5e
am: a1299b7ca8
Change-Id: I9b17e5bcb16710996a90db71c9408eb5ed9de555
diff --git a/main.cc b/main.cc
index 91805ae..0b96307 100644
--- a/main.cc
+++ b/main.cc
@@ -89,7 +89,7 @@
string log_file;
if (log_to_file) {
#ifdef __ANDROID__
- log_file = "/data/misc/update_engine/update_engine.log";
+ log_file = "/data/misc/update_engine_log/update_engine.log";
log_settings.delete_old = logging::DELETE_OLD_LOG_FILE;
#else
log_file = SetupLogFile("/var/log");
@@ -98,6 +98,12 @@
log_settings.log_file = log_file.c_str();
}
logging::InitLogging(log_settings);
+
+#ifdef __ANDROID__
+ // The log file will have AID_LOG as group ID; this GID is inherited from the
+ // parent directory "/data/misc/update_engine_log" which sets the SGID bit.
+ chmod(log_file.c_str(), 0640);
+#endif
}
} // namespace