summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris+github@qwirx.com>2007-03-10 19:26:02 +0000
committerChris Wilson <chris+github@qwirx.com>2007-03-10 19:26:02 +0000
commitf6cbd5bfc97fb701685dc17b0cfcbbbdb0ff1bcd (patch)
tree8f8326c3e9a218b1b4787663c303bb889ff500bf
parent50f4c4a76a07ce1d34c4e50094d570a5087084cb (diff)
Remove #ifdefs, no longer required (refs #3, merges [1418])
-rw-r--r--lib/common/UnixUser.cpp21
1 files changed, 3 insertions, 18 deletions
diff --git a/lib/common/UnixUser.cpp b/lib/common/UnixUser.cpp
index 1ec9608d..f81b474c 100644
--- a/lib/common/UnixUser.cpp
+++ b/lib/common/UnixUser.cpp
@@ -78,12 +78,7 @@ UnixUser::~UnixUser()
if(mRevertOnDestruction)
{
// Revert to "real" user and group id of the process
- #ifdef WIN32
- if(0)
- #else
- if(::setegid(::getgid()) != 0
- || ::seteuid(::getuid()) != 0)
- #endif
+ if(::setegid(::getgid()) != 0 || ::seteuid(::getuid()) != 0)
{
THROW_EXCEPTION(CommonException, CouldNotRestoreProcessUser)
}
@@ -105,12 +100,7 @@ void UnixUser::ChangeProcessUser(bool Temporary)
if(Temporary)
{
// Change temporarily (change effective only)
- #ifdef WIN32
- if(0)
- #else
- if(::setegid(mGID) != 0
- || ::seteuid(mUID) != 0)
- #endif
+ if(::setegid(mGID) != 0 || ::seteuid(mUID) != 0)
{
THROW_EXCEPTION(CommonException, CouldNotChangeProcessUser)
}
@@ -121,12 +111,7 @@ void UnixUser::ChangeProcessUser(bool Temporary)
else
{
// Change permanently (change all UIDs and GIDs)
- #ifdef WIN32
- if(0)
- #else
- if(::setgid(mGID) != 0
- || ::setuid(mUID) != 0)
- #endif
+ if(::setgid(mGID) != 0 || ::setuid(mUID) != 0)
{
THROW_EXCEPTION(CommonException, CouldNotChangeProcessUser)
}