- Timestamp:
- Jun 23, 2009 12:42:19 PM (16 years ago)
- svn:sync-xref-src-repo-rev:
- 48960
- Location:
- trunk/src/VBox/Runtime
- Files:
-
- 1 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/r3/init.cpp
r19924 r20821 59 59 # include <iprt/file.h> 60 60 # include <VBox/sup.h> 61 # include <stdlib.h> 62 #endif 63 61 #endif 62 #include <stdlib.h> 63 64 #include "internal/alignmentchecks.h" 64 65 #include "internal/path.h" 65 66 #include "internal/process.h" … … 112 113 RTPROCPRIORITY g_enmProcessPriority = RTPROCPRIORITY_DEFAULT; 113 114 115 #ifdef DEBUG 116 /** 117 * Whether alignment checks are enabled. 118 * This is set if the environment variable IPRT_ALIGNMENT_CHECKS is 1. 119 */ 120 RTDATADECL(bool) g_fRTAlignmentChecks = false; 121 #endif 122 123 114 124 115 125 #ifndef RT_OS_WINDOWS … … 195 205 const char *pszDisableHostCache = getenv("VBOX_DISABLE_HOST_DISK_CACHE"); 196 206 if ( pszDisableHostCache != NULL 197 && strlen(pszDisableHostCache) > 0207 && *pszDisableHostCache 198 208 && strcmp(pszDisableHostCache, "0") != 0) 199 209 { … … 263 273 #endif 264 274 275 #if defined(DEBUG) 276 /* 277 * Enable alignment checks. 278 */ 279 const char *pszAlignmentChecks = getenv("IPRT_ALIGNMENT_CHECKS"); 280 g_fRTAlignmentChecks = pszAlignmentChecks != NULL 281 && pszAlignmentChecks[0] == '1' 282 && pszAlignmentChecks[1] == '\0'; 283 if (g_fRTAlignmentChecks) 284 IPRT_ALIGNMENT_CHECKS_ENABLE(); 285 #endif 286 265 287 return VINF_SUCCESS; 266 288 } -
trunk/src/VBox/Runtime/r3/posix/env-posix.cpp
r16526 r20821 41 41 #include <iprt/alloca.h> 42 42 #include <iprt/assert.h> 43 #if defined(DEBUG) && defined(RT_OS_LINUX) 44 # include <iprt/asm.h> 45 #endif 43 46 44 47 #include <stdlib.h> 45 48 #include <errno.h> 46 49 50 #include "internal/alignmentchecks.h" 51 47 52 48 53 RTDECL(bool) RTEnvExist(const char *pszVar) 49 54 { 50 return getenv(pszVar) != NULL;55 return RTEnvGet(pszVar) != NULL; 51 56 } 52 57 … … 54 59 RTDECL(const char *) RTEnvGet(const char *pszVar) 55 60 { 56 return getenv(pszVar); 61 IPRT_ALIGNMENT_CHECKS_DISABLE(); /* glibc causes trouble */ 62 const char *pszValue = getenv(pszVar); 63 IPRT_ALIGNMENT_CHECKS_ENABLE(); 64 return pszValue; 57 65 } 58 66 … … 86 94 return 0; 87 95 return RTErrConvertFromErrno(errno); 88 96 89 97 #else 90 98 if (!setenv(pszVar, pszValue, 1)) 91 99 return VINF_SUCCESS; 92 100 return RTErrConvertFromErrno(errno); 93 #endif 101 #endif 94 102 } 95 103
Note:
See TracChangeset
for help on using the changeset viewer.