Browse Source

top: Use Core::System::ioctl()

Andreas Kling 3 years ago
parent
commit
fd2ea6923c
1 changed files with 1 additions and 5 deletions
  1. 1 5
      Userland/Utilities/top.cpp

+ 1 - 5
Userland/Utilities/top.cpp

@@ -197,11 +197,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
     usleep(10000);
     for (;;) {
         if (g_window_size_changed) {
-            int rc = ioctl(STDOUT_FILENO, TIOCGWINSZ, &g_window_size);
-            if (rc < 0) {
-                perror("ioctl(TIOCGWINSZ)");
-                return 1;
-            }
+            TRY(Core::System::ioctl(STDOUT_FILENO, TIOCGWINSZ, &g_window_size));
             g_window_size_changed = false;
         }