diff options
author | Andreas Kling <kling@serenityos.org> | 2021-02-23 20:42:32 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-02-23 20:56:54 +0100 |
commit | 5d180d1f996ead27f9c5cb3db7f91e293de34d9d (patch) | |
tree | e881854dac5d749518562970d6194a0ef65736ec /Userland/DevTools/HackStudio/TerminalWrapper.cpp | |
parent | b33a6a443e700cd80325d312f21c985b0687bb97 (diff) | |
download | serenity-5d180d1f996ead27f9c5cb3db7f91e293de34d9d.zip |
Everywhere: Rename ASSERT => VERIFY
(...and ASSERT_NOT_REACHED => VERIFY_NOT_REACHED)
Since all of these checks are done in release builds as well,
let's rename them to VERIFY to prevent confusion, as everyone is
used to assertions being compiled out in release.
We can introduce a new ASSERT macro that is specifically for debug
checks, but I'm doing this wholesale conversion first since we've
accumulated thousands of these already, and it's not immediately
obvious which ones are suitable for ASSERT.
Diffstat (limited to 'Userland/DevTools/HackStudio/TerminalWrapper.cpp')
-rw-r--r-- | Userland/DevTools/HackStudio/TerminalWrapper.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/Userland/DevTools/HackStudio/TerminalWrapper.cpp b/Userland/DevTools/HackStudio/TerminalWrapper.cpp index 42d91cfc91..0488352970 100644 --- a/Userland/DevTools/HackStudio/TerminalWrapper.cpp +++ b/Userland/DevTools/HackStudio/TerminalWrapper.cpp @@ -55,15 +55,15 @@ void TerminalWrapper::run_command(const String& command) int ptm_fd = posix_openpt(O_RDWR | O_CLOEXEC); if (ptm_fd < 0) { perror("posix_openpt"); - ASSERT_NOT_REACHED(); + VERIFY_NOT_REACHED(); } if (grantpt(ptm_fd) < 0) { perror("grantpt"); - ASSERT_NOT_REACHED(); + VERIFY_NOT_REACHED(); } if (unlockpt(ptm_fd) < 0) { perror("unlockpt"); - ASSERT_NOT_REACHED(); + VERIFY_NOT_REACHED(); } m_terminal_widget->set_pty_master_fd(ptm_fd); @@ -72,7 +72,7 @@ void TerminalWrapper::run_command(const String& command) int rc = waitpid(m_pid, &wstatus, 0); if (rc < 0) { perror("waitpid"); - ASSERT_NOT_REACHED(); + VERIFY_NOT_REACHED(); } if (WIFEXITED(wstatus)) { m_terminal_widget->inject_string(String::formatted("\033[{};1m(Command exited with code {})\033[0m\n", wstatus == 0 ? 32 : 31, WEXITSTATUS(wstatus))); @@ -147,7 +147,7 @@ void TerminalWrapper::run_command(const String& command) setenv("TERM", "xterm", true); auto parts = command.split(' '); - ASSERT(!parts.is_empty()); + VERIFY(!parts.is_empty()); const char** args = (const char**)calloc(parts.size() + 1, sizeof(const char*)); for (size_t i = 0; i < parts.size(); i++) { args[i] = parts[i].characters(); @@ -157,7 +157,7 @@ void TerminalWrapper::run_command(const String& command) perror("execve"); exit(1); } - ASSERT_NOT_REACHED(); + VERIFY_NOT_REACHED(); } // (In parent process) @@ -166,7 +166,7 @@ void TerminalWrapper::run_command(const String& command) void TerminalWrapper::kill_running_command() { - ASSERT(m_pid != -1); + VERIFY(m_pid != -1); // Kill our child process and its whole process group. [[maybe_unused]] auto rc = killpg(m_pid, SIGTERM); |