1
0
Fork 0
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:
jules 2014-08-05 10:26:31 +01:00
parent 29ae02ad7f
commit a9750c0e38

View file

@ -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(); }