From 6e05501e8786f651fbf871c414c50573e5fecfb8 Mon Sep 17 00:00:00 2001 From: Felix Morgner Date: Wed, 17 Jun 2026 10:36:20 +0200 Subject: app: implement basic signal handling --- ttwhy/scoped_attributes.cppm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'ttwhy/scoped_attributes.cppm') 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. -- cgit v1.2.3