mirror of
https://github.com/RGBCube/serenity
synced 2025-05-14 09:24:57 +00:00
ps: Use Core::System::fstat()
This commit is contained in:
parent
46510bbb64
commit
61552415a3
1 changed files with 1 additions and 7 deletions
|
@ -14,13 +14,7 @@
|
|||
|
||||
static ErrorOr<DeprecatedString> 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);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue