Applying clang-format suggestions in PROCPRIO cmd am: 8b5a67d35a am: a0e25cea31
Original change: https://android-review.googlesource.com/c/platform/system/memory/lmkd/+/3073186 Change-Id: I01f2fa6d135c929641ca1f0ac748537b5a473469 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
commit
1211db6082
10
lmkd.cpp
10
lmkd.cpp
|
|
@ -1228,8 +1228,7 @@ static void cmd_procprio(LMKD_CTRL_PACKET packet, int field_count, struct ucred*
|
||||||
|
|
||||||
lmkd_pack_get_procprio(packet, field_count, ¶ms);
|
lmkd_pack_get_procprio(packet, field_count, ¶ms);
|
||||||
|
|
||||||
if (params.oomadj < OOM_SCORE_ADJ_MIN ||
|
if (params.oomadj < OOM_SCORE_ADJ_MIN || params.oomadj > OOM_SCORE_ADJ_MAX) {
|
||||||
params.oomadj > OOM_SCORE_ADJ_MAX) {
|
|
||||||
ALOGE("Invalid PROCPRIO oomadj argument %d", params.oomadj);
|
ALOGE("Invalid PROCPRIO oomadj argument %d", params.oomadj);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
@ -1243,7 +1242,8 @@ static void cmd_procprio(LMKD_CTRL_PACKET packet, int field_count, struct ucred*
|
||||||
if (read_proc_status(params.pid, buf, sizeof(buf))) {
|
if (read_proc_status(params.pid, buf, sizeof(buf))) {
|
||||||
if (parse_status_tag(buf, PROC_STATUS_TGID_FIELD, &tgid) && tgid != params.pid) {
|
if (parse_status_tag(buf, PROC_STATUS_TGID_FIELD, &tgid) && tgid != params.pid) {
|
||||||
ALOGE("Attempt to register a task that is not a thread group leader "
|
ALOGE("Attempt to register a task that is not a thread group leader "
|
||||||
"(tid %d, tgid %" PRId64 ")", params.pid, tgid);
|
"(tid %d, tgid %" PRId64 ")",
|
||||||
|
params.pid, tgid);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1254,8 +1254,8 @@ static void cmd_procprio(LMKD_CTRL_PACKET packet, int field_count, struct ucred*
|
||||||
snprintf(path, sizeof(path), "/proc/%d/oom_score_adj", params.pid);
|
snprintf(path, sizeof(path), "/proc/%d/oom_score_adj", params.pid);
|
||||||
snprintf(val, sizeof(val), "%d", params.oomadj);
|
snprintf(val, sizeof(val), "%d", params.oomadj);
|
||||||
if (!writefilestring(path, val, false)) {
|
if (!writefilestring(path, val, false)) {
|
||||||
ALOGW("Failed to open %s; errno=%d: process %d might have been killed",
|
ALOGW("Failed to open %s; errno=%d: process %d might have been killed", path, errno,
|
||||||
path, errno, params.pid);
|
params.pid);
|
||||||
/* If this file does not exist the process is dead. */
|
/* If this file does not exist the process is dead. */
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue