summaryrefslogtreecommitdiffstats
path: root/logd/LogWhiteBlackList.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'logd/LogWhiteBlackList.cpp')
-rw-r--r--logd/LogWhiteBlackList.cpp17
1 files changed, 11 insertions, 6 deletions
diff --git a/logd/LogWhiteBlackList.cpp b/logd/LogWhiteBlackList.cpp
index e87b604..bee940d 100644
--- a/logd/LogWhiteBlackList.cpp
+++ b/logd/LogWhiteBlackList.cpp
@@ -39,15 +39,20 @@ int Prune::cmp(uid_t uid, pid_t pid) const {
void Prune::format(char **strp) {
if (mUid != uid_all) {
- asprintf(strp, (mPid != pid_all) ? "%u/%u" : "%u", mUid, mPid);
- } else {
- // NB: mPid == pid_all can not happen if mUid == uid_all
- asprintf(strp, (mPid != pid_all) ? "/%u" : "/", mPid);
+ if (mPid != pid_all) {
+ asprintf(strp, "%u/%u", mUid, mPid);
+ } else {
+ asprintf(strp, "%u", mUid);
+ }
+ } else if (mPid != pid_all) {
+ asprintf(strp, "/%u", mPid);
+ } else { // NB: mPid == pid_all can not happen if mUid == uid_all
+ asprintf(strp, "/");
}
}
PruneList::PruneList()
- : mWorstUidEnabled(false) {
+ : mWorstUidEnabled(true) {
mNaughty.clear();
mNice.clear();
}
@@ -65,7 +70,7 @@ PruneList::~PruneList() {
}
int PruneList::init(char *str) {
- mWorstUidEnabled = false;
+ mWorstUidEnabled = true;
PruneCollection::iterator it;
for (it = mNice.begin(); it != mNice.end();) {
delete (*it);