diff options
author | Caolán McNamara <caolanm@redhat.com> | 2012-01-04 10:47:29 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2012-01-05 09:18:20 +0000 |
commit | 17642437fe0d68cf868ab430f04b4fdc12f1767f (patch) | |
tree | f8824c7c17cd573a66e1bcc8f44afa1ac002c832 /sal/osl/unx | |
parent | d3e3dbaf542b527c55c5643b639ac2f4e1a0dd09 (diff) |
reduce ifdef forest
Diffstat (limited to 'sal/osl/unx')
-rw-r--r-- | sal/osl/unx/process.cxx | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/sal/osl/unx/process.cxx b/sal/osl/unx/process.cxx index 49a57e2c81a3..cfaecde575a5 100644 --- a/sal/osl/unx/process.cxx +++ b/sal/osl/unx/process.cxx @@ -27,6 +27,7 @@ ************************************************************************/ #include "sal/config.h" +#include "rtl/ustring.hxx" #include <cassert> @@ -500,17 +501,15 @@ static void ChildStatusProc(void *pData) if (! INIT_GROUPS(data.m_name, data.m_gid) || (setuid(data.m_uid) != 0)) OSL_TRACE("Failed to change uid and guid, errno=%d (%s)", errno, strerror(errno)); -#if defined(LINUX) || defined (FREEBSD) || defined(NETBSD) || defined(OPENBSD) || defined(IOS) || defined(DRAGONFLY) - unsetenv("HOME"); -#else - putenv("HOME="); -#endif + + const rtl::OUString envVar(RTL_CONSTASCII_USTRINGPARAM("HOME")); + osl_clearEnvironment(envVar.pData); } - if (data.m_pszDir) - chstatus = chdir(data.m_pszDir); + if (data.m_pszDir) + chstatus = chdir(data.m_pszDir); - if (chstatus == 0 && ((data.m_uid == (uid_t)-1) || ((data.m_uid == getuid()) && (data.m_gid == getgid())))) + if (chstatus == 0 && ((data.m_uid == (uid_t)-1) || ((data.m_uid == getuid()) && (data.m_gid == getgid())))) { int i; for (i = 0; data.m_pszEnv[i] != NULL; i++) |