summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNathan Scott <nathans@redhat.com>2020-08-31 16:57:46 +1000
committerNathan Scott <nathans@redhat.com>2020-08-31 16:57:46 +1000
commitb321177b0871af9a32cc3417532cdb1b40e3fc26 (patch)
tree03e02b003d9d0712e0056a0f1538adaf5589e9a5
parent800d8c735d3085e90ecef426ba4ebda7b80df46b (diff)
parentf14173038ece83f79df9ecc2349b9b5e2292a32a (diff)
Merge branch 'master' of github.com:htop-dev/htop
-rw-r--r--linux/LinuxProcess.c7
-rw-r--r--linux/LinuxProcessList.c2
2 files changed, 4 insertions, 5 deletions
diff --git a/linux/LinuxProcess.c b/linux/LinuxProcess.c
index 3a150495..6bae9886 100644
--- a/linux/LinuxProcess.c
+++ b/linux/LinuxProcess.c
@@ -241,7 +241,7 @@ ProcessFieldData Process_fields[] = {
#ifdef HAVE_CGROUP
[CGROUP] = { .name = "CGROUP", .title = " CGROUP ", .description = "Which cgroup the process is in", .flags = PROCESS_FLAG_LINUX_CGROUP, },
#endif
- [OOM] = { .name = "OOM", .title = " OOM ", .description = "OOM (Out-of-Memory) killer score", .flags = PROCESS_FLAG_LINUX_OOM, },
+ [OOM] = { .name = "OOM", .title = " OOM ", .description = "OOM (Out-of-Memory) killer score", .flags = PROCESS_FLAG_LINUX_OOM, },
[IO_PRIORITY] = { .name = "IO_PRIORITY", .title = "IO ", .description = "I/O priority", .flags = PROCESS_FLAG_LINUX_IOPRIO, },
#ifdef HAVE_DELAYACCT
[PERCENT_CPU_DELAY] = { .name = "PERCENT_CPU_DELAY", .title = "CPUD% ", .description = "CPU delay %", .flags = 0, },
@@ -264,7 +264,6 @@ ProcessPidColumn Process_pidColumns[] = {
{ .id = TGID, .label = "TGID" },
{ .id = PGRP, .label = "PGRP" },
{ .id = SESSION, .label = "SID" },
- { .id = OOM, .label = "OOM" },
{ .id = 0, .label = NULL },
};
@@ -397,7 +396,7 @@ void LinuxProcess_writeField(Process* this, RichString* str, ProcessField field)
#ifdef HAVE_CGROUP
case CGROUP: xSnprintf(buffer, n, "%-10s ", lp->cgroup); break;
#endif
- case OOM: xSnprintf(buffer, n, Process_pidFormat, lp->oom); break;
+ case OOM: xSnprintf(buffer, n, "%4u ", lp->oom); break;
case IO_PRIORITY: {
int klass = IOPriority_class(lp->ioPriority);
if (klass == IOPRIO_CLASS_NONE) {
@@ -493,7 +492,7 @@ long LinuxProcess_compare(const void* v1, const void* v2) {
return strcmp(p1->cgroup ? p1->cgroup : "", p2->cgroup ? p2->cgroup : "");
#endif
case OOM:
- return (p2->oom - p1->oom);
+ return ((long)p2->oom - (long)p1->oom);
#ifdef HAVE_DELAYACCT
case PERCENT_CPU_DELAY:
return (p2->cpu_delay_percent > p1->cpu_delay_percent ? 1 : -1);
diff --git a/linux/LinuxProcessList.c b/linux/LinuxProcessList.c
index e426785f..2919d4b8 100644
--- a/linux/LinuxProcessList.c
+++ b/linux/LinuxProcessList.c
@@ -671,7 +671,7 @@ static void LinuxProcessList_readOomData(LinuxProcess* process, const char* dirn
char buffer[PROC_LINE_LENGTH + 1];
if (fgets(buffer, PROC_LINE_LENGTH, file)) {
unsigned int oom;
- int ok = sscanf(buffer, "%32u", &oom);
+ int ok = sscanf(buffer, "%u", &oom);
if (ok >= 1) {
process->oom = oom;
}

© 2014-2024 Faster IT GmbH | imprint | privacy policy