Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(glog): no read permission on the cwd on Android #835

Merged
merged 6 commits into from
Mar 4, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions src/rime/lever/deployment_tasks.cc
Original file line number Diff line number Diff line change
Expand Up @@ -628,10 +628,6 @@ bool CleanOldLogFiles::Run(Deployer* deployer) {
string today(ymd);
DLOG(INFO) << "today: " << today;

// Make sure we have sufficient permissions on the scanned directories.
// E.g. on Android, there's no write permission on the cwd.
// update: Now it no longer actively detects directory permissions,
// leaving it up to the try catch below to avoid permissions exceptions.
vector<string> dirs(google::GetLoggingDirectories());

DLOG(INFO) << "scanning " << dirs.size() << " temp directory for log files.";
Expand All @@ -651,6 +647,8 @@ bool CleanOldLogFiles::Run(Deployer* deployer) {
}
}
mokapsing marked this conversation as resolved.
Show resolved Hide resolved
} catch (const fs::filesystem_error& ex) {
// Catch error to skip up when we have no sufficient permissions.
// E.g. on Android, there's no write permission on the cwd.
LOG(ERROR) << ex.what();
mokapsing marked this conversation as resolved.
Show resolved Hide resolved
continue;
}
Expand Down