aboutsummaryrefslogtreecommitdiff
path: root/ttwhy/scoped_attributes.cppm
diff options
context:
space:
mode:
authorFelix Morgner <felix.morgner@gmail.com>2026-06-17 10:36:20 +0200
committerFelix Morgner <felix.morgner@gmail.com>2026-06-17 10:36:20 +0200
commit6e05501e8786f651fbf871c414c50573e5fecfb8 (patch)
tree7dd8ef5944cc65d8f113e54b44443872292de681 /ttwhy/scoped_attributes.cppm
parentf47fda7c8061303c0762c6b11b5f916993ead7ca (diff)
downloadttwhy-6e05501e8786f651fbf871c414c50573e5fecfb8.tar.xz
ttwhy-6e05501e8786f651fbf871c414c50573e5fecfb8.zip
app: implement basic signal handling
Diffstat (limited to 'ttwhy/scoped_attributes.cppm')
-rw-r--r--ttwhy/scoped_attributes.cppm5
1 files changed, 4 insertions, 1 deletions
diff --git a/ttwhy/scoped_attributes.cppm b/ttwhy/scoped_attributes.cppm
index dd66b54..7c32ddf 100644
--- a/ttwhy/scoped_attributes.cppm
+++ b/ttwhy/scoped_attributes.cppm
@@ -45,7 +45,10 @@ namespace ttwhy
active_attributes.c_lflag = active_attributes.c_lflag & ~flag;
}
- tcsetattr(file_descriptor, TCSANOW, &active_attributes);
+ if (tcsetattr(file_descriptor, TCSANOW, &active_attributes))
+ {
+ throw std::system_error(errno, std::system_category(), "failed to write termios attributes");
+ }
}
//! Store the current TC attributes and restore them on destruction.