diff options
author | Hisham <hisham@gobolinux.org> | 2016-10-01 03:09:04 -0300 |
---|---|---|
committer | Hisham <hisham@gobolinux.org> | 2016-10-01 03:09:04 -0300 |
commit | 8af4d9f453ffa2209e486418811f7652822951c6 (patch) | |
tree | 432b6b39b0f9f7c746224370ccf438eea3495ac6 /Process.c | |
parent | 8a147dd5b4bc35feebb14a3a55ee44186ce3cea4 (diff) |
Interpret TTY_NR column on Linux,
translate dev_t to major:minor on other platforms.
Closes #316.
Diffstat (limited to 'Process.c')
-rw-r--r-- | Process.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -18,6 +18,7 @@ in the source distribution for its full text. #include <sys/resource.h> #include <sys/param.h> #include <sys/stat.h> +#include <sys/types.h> #include <unistd.h> #include <stdlib.h> #include <signal.h> @@ -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]; |