diff --git a/hal/src/main/native/athena/Threads.cpp b/hal/src/main/native/athena/Threads.cpp index d60b2800a7..f7afa91992 100644 --- a/hal/src/main/native/athena/Threads.cpp +++ b/hal/src/main/native/athena/Threads.cpp @@ -31,7 +31,7 @@ class UidSetter { } ~UidSetter() noexcept(false) { - if (seteuid(m_uid) == -1) { + if (geteuid() != m_uid && seteuid(m_uid) == -1) { throw std::system_error(errno, std::generic_category(), fmt::format("seteuid({}) failed", m_uid)); }