aboutsummaryrefslogtreecommitdiff
path: root/ttwhy/scoped_attributes.cppm
diff options
context:
space:
mode:
authorFelix Morgner <felix.morgner@gmail.com>2026-06-18 09:05:34 +0200
committerFelix Morgner <felix.morgner@gmail.com>2026-06-18 09:05:34 +0200
commit4a365d974b17f71914909df8fe532edc929f3cad (patch)
tree148f33e962bdd17e1dda3ba7a88d17e778e9f9a0 /ttwhy/scoped_attributes.cppm
parent6dc9508bf13d78a990a36b2b43e9fa498ddbe228 (diff)
downloadttwhy-4a365d974b17f71914909df8fe532edc929f3cad.tar.xz
ttwhy-4a365d974b17f71914909df8fe532edc929f3cad.zip
chore: clean up code
Diffstat (limited to 'ttwhy/scoped_attributes.cppm')
-rw-r--r--ttwhy/scoped_attributes.cppm10
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);
}
}