From 8af4d9f453ffa2209e486418811f7652822951c6 Mon Sep 17 00:00:00 2001 From: Hisham Date: Sat, 1 Oct 2016 03:09:04 -0300 Subject: Interpret TTY_NR column on Linux, translate dev_t to major:minor on other platforms. Closes #316. --- Process.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'Process.c') diff --git a/Process.c b/Process.c index 6a904e2c..a1ffcf0e 100644 --- a/Process.c +++ b/Process.c @@ -18,6 +18,7 @@ in the source distribution for its full text. #include #include #include +#include #include #include #include @@ -454,7 +455,7 @@ void Process_writeField(Process* this, RichString* str, ProcessField field) { case TIME: Process_printTime(str, this->time); return; case TGID: snprintf(buffer, n, Process_pidFormat, this->tgid); break; case TPGID: snprintf(buffer, n, Process_pidFormat, this->tpgid); break; - case TTY_NR: snprintf(buffer, n, "%5u ", this->tty_nr); break; + case TTY_NR: snprintf(buffer, n, "%3u:%3u ", major(this->tty_nr), minor(this->tty_nr)); break; case USER: { if (Process_getuid != (int) this->st_uid) attr = CRT_colors[PROCESS_SHADOW]; -- cgit v1.2.3