Fix column misalignment for priority -101 threads

BFS-patched kernels can have kernel threads with priority -101.
This change makes priority -101 display as "RT", just like priority -100.

Related: https://github.com/hishamhm/htop/issues/314
This commit is contained in:
Ivan Kozik 2016-09-06 09:22:38 +00:00 committed by GitHub
parent 6d4df3d138
commit 07086fcf77
1 changed files with 1 additions and 1 deletions

View File

@ -429,7 +429,7 @@ void Process_writeField(Process* this, RichString* str, ProcessField field) {
case PID: snprintf(buffer, n, Process_pidFormat, this->pid); break; case PID: snprintf(buffer, n, Process_pidFormat, this->pid); break;
case PPID: snprintf(buffer, n, Process_pidFormat, this->ppid); break; case PPID: snprintf(buffer, n, Process_pidFormat, this->ppid); break;
case PRIORITY: { case PRIORITY: {
if(this->priority == -100) if(this->priority <= -100)
snprintf(buffer, n, " RT "); snprintf(buffer, n, " RT ");
else else
snprintf(buffer, n, "%3ld ", this->priority); snprintf(buffer, n, "%3ld ", this->priority);