mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-02-01 03:10:06 +00:00
Workaround for linux gcc warning.
This commit is contained in:
parent
29ae02ad7f
commit
a9750c0e38
1 changed files with 4 additions and 3 deletions
|
|
@ -79,10 +79,11 @@ JUCE_API bool JUCE_CALLTYPE Process::isRunningUnderDebugger()
|
|||
return juce_isRunningUnderDebugger();
|
||||
}
|
||||
|
||||
static void swapUserAndEffectiveUser()
|
||||
static bool swapUserAndEffectiveUser()
|
||||
{
|
||||
(void) setreuid (geteuid(), getuid());
|
||||
(void) setregid (getegid(), getgid());
|
||||
int result1 = setreuid (geteuid(), getuid());
|
||||
int result2 = setregid (getegid(), getgid());
|
||||
return result1 == 0 && result2 == 0;
|
||||
}
|
||||
|
||||
JUCE_API void JUCE_CALLTYPE Process::raisePrivilege() { if (geteuid() != 0 && getuid() == 0) swapUserAndEffectiveUser(); }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue