blob: 006564b024efc78a084fc2f424661ef96fdf6713 [file] [log] [blame]
Description: Update log file directory.
Author: Umang Parmar <umangjparmar@gmail.com>
Last Updated: 2018-05-17
--- a/system/core/adb/adb_utils.cpp
+++ b/system/core/adb/adb_utils.cpp
@@ -339,6 +339,11 @@
return temp_path_utf8 + log_name;
#else
+ std::string log_dir = android::base::StringPrintf("/run/user/%u/adb.log", getuid());
+ struct stat st = {0};
+ if (stat(log_dir.c_str(), &st) == 0) {
+ return log_dir;
+ }
const char* tmp_dir = getenv("TMPDIR");
if (tmp_dir == nullptr) tmp_dir = "/tmp";
return android::base::StringPrintf("%s/adb.%u.log", tmp_dir, getuid());