From: Umang Parmar Date: Fri, 20 Jan 2023 08:36:41 +0000 (+0000) Subject: Update log file directory. X-Git-Tag: archive/raspbian/29.0.6-23+rpi1^2~35 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=e84986779a2ac60d5e06e9441ddc91a438ed21ff;p=android-platform-tools.git Update log file directory. Last Updated: 2018-05-17 Last Updated: 2018-05-17 Gbp-Pq: Topic system/core Gbp-Pq: Name move-log-file-to-proper-dir.patch --- diff --git a/system/core/adb/adb_utils.cpp b/system/core/adb/adb_utils.cpp index d1910f1c..9a9568c7 100644 --- a/system/core/adb/adb_utils.cpp +++ b/system/core/adb/adb_utils.cpp @@ -343,6 +343,11 @@ std::string GetLogFilePath() { 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());