diff options
-rw-r--r-- | Userland/Utilities/ps.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Userland/Utilities/ps.cpp b/Userland/Utilities/ps.cpp index 7b6f934fc2..a7bea5933d 100644 --- a/Userland/Utilities/ps.cpp +++ b/Userland/Utilities/ps.cpp @@ -20,15 +20,18 @@ static ErrorOr<String> determine_tty_pseudo_name() perror("fstat"); return Error::from_errno(saved_errno); } + int tty_device_major = major(tty_stat.st_rdev); int tty_device_minor = minor(tty_stat.st_rdev); + if (tty_device_major == 201) { return String::formatted("pts:{}", tty_device_minor); } + if (tty_device_major == 4) { return String::formatted("tty:{}", tty_device_minor); } - VERIFY_NOT_REACHED(); + return "n/a"; } ErrorOr<int> serenity_main(Main::Arguments arguments) |