mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-24 01:31:46 +00:00
[hal] UidSetter: Don't revert euid if its already current value (#3566)
When running from admin account, this hangs for 5-10 seconds. Co-authored-by: Tyler Veness <calcmogul@gmail.com>
This commit is contained in:
@@ -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));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user