diff --git a/Userland/Utilities/ps.cpp b/Userland/Utilities/ps.cpp index 8bddf297220..16af870cea4 100644 --- a/Userland/Utilities/ps.cpp +++ b/Userland/Utilities/ps.cpp @@ -14,13 +14,7 @@ static ErrorOr determine_tty_pseudo_name() { - struct stat tty_stat; - if (fstat(STDIN_FILENO, &tty_stat) < 0) { - int saved_errno = errno; - perror("fstat"); - return Error::from_errno(saved_errno); - } - + auto tty_stat = TRY(Core::System::fstat(STDIN_FILENO)); int tty_device_major = major(tty_stat.st_rdev); int tty_device_minor = minor(tty_stat.st_rdev);