From 4a365d974b17f71914909df8fe532edc929f3cad Mon Sep 17 00:00:00 2001 From: Felix Morgner Date: Thu, 18 Jun 2026 09:05:34 +0200 Subject: chore: clean up code --- ttwhy/scoped_attributes.cppm | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'ttwhy/scoped_attributes.cppm') diff --git a/ttwhy/scoped_attributes.cppm b/ttwhy/scoped_attributes.cppm index 243d4ac..c68ab01 100644 --- a/ttwhy/scoped_attributes.cppm +++ b/ttwhy/scoped_attributes.cppm @@ -15,7 +15,7 @@ namespace ttwhy auto static read_attributes(int file_descriptor) -> termios { auto active_attributes = termios{}; - if (tcgetattr(file_descriptor, &active_attributes)) + if (::tcgetattr(file_descriptor, &active_attributes)) { throw std::system_error(errno, std::system_category(), "failed to read termios attributes"); } @@ -46,7 +46,7 @@ namespace ttwhy active_attributes.c_lflag = active_attributes.c_lflag & ~flag; } - if (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"); } @@ -56,7 +56,7 @@ namespace ttwhy export struct scoped_attributes { explicit scoped_attributes(int file_descriptor) - : m_file_descriptor{dup(file_descriptor)} + : m_file_descriptor{::dup(file_descriptor)} , m_attributes{read_attributes(file_descriptor)} {} @@ -71,8 +71,8 @@ namespace ttwhy { if (m_file_descriptor > 0) { - tcsetattr(m_file_descriptor, TCSANOW, &m_attributes); - close(m_file_descriptor); + ::tcsetattr(m_file_descriptor, TCSANOW, &m_attributes); + ::close(m_file_descriptor); } } -- cgit v1.2.3