diff options
Diffstat (limited to 'ttwhy/scoped_attributes.cppm')
| -rw-r--r-- | ttwhy/scoped_attributes.cppm | 10 |
1 files changed, 5 insertions, 5 deletions
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); } } |
