From 56f7d79efdc8ad26f5e8e5508eb616144f04fea3 Mon Sep 17 00:00:00 2001 From: Benjamin Barenblat Date: Sun, 26 Dec 2021 15:25:03 -0500 Subject: Throw errno failures with std::system_category --- goldfishterm/terminfo_test.cc | 2 +- src/ui/terminal/line.cc | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/goldfishterm/terminfo_test.cc b/goldfishterm/terminfo_test.cc index c50cb90..6bb2652 100644 --- a/goldfishterm/terminfo_test.cc +++ b/goldfishterm/terminfo_test.cc @@ -42,7 +42,7 @@ using ::testing::Optional; void SetEnv(const char* var, const char* val) { if (setenv(var, val, /*overwrite=*/1)) { - throw std::system_error(errno, std::generic_category(), "setenv"); + throw std::system_error(errno, std::system_category(), "setenv"); } } diff --git a/src/ui/terminal/line.cc b/src/ui/terminal/line.cc index 0848b22..962b692 100644 --- a/src/ui/terminal/line.cc +++ b/src/ui/terminal/line.cc @@ -45,7 +45,7 @@ constexpr absl::string_view kBeginningOfLine = "\r"; int CheckedCall(const char* what_arg, int r) { if (r < 0) { - throw std::system_error(errno, std::generic_category(), what_arg); + throw std::system_error(errno, std::system_category(), what_arg); } return r; } @@ -137,7 +137,7 @@ char TerminalLine::GetChar() { } else if (errno == EINTR) { continue; } else { - throw std::system_error(errno, std::generic_category(), "read"); + throw std::system_error(errno, std::system_category(), "read"); } } } -- cgit v1.2.3