VirtualBox

Changeset 20821 in vbox for trunk/src/VBox/Runtime/r3/posix


Ignore:
Timestamp:
Jun 23, 2009 12:42:19 PM (16 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
48960
Message:

IPRT: alignment check hacking.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/r3/posix/env-posix.cpp

    r16526 r20821  
    4141#include <iprt/alloca.h>
    4242#include <iprt/assert.h>
     43#if defined(DEBUG) && defined(RT_OS_LINUX)
     44# include <iprt/asm.h>
     45#endif
    4346
    4447#include <stdlib.h>
    4548#include <errno.h>
    4649
     50#include "internal/alignmentchecks.h"
     51
    4752
    4853RTDECL(bool) RTEnvExist(const char *pszVar)
    4954{
    50     return getenv(pszVar) != NULL;
     55    return RTEnvGet(pszVar) != NULL;
    5156}
    5257
     
    5459RTDECL(const char *) RTEnvGet(const char *pszVar)
    5560{
    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;
    5765}
    5866
     
    8694        return 0;
    8795    return RTErrConvertFromErrno(errno);
    88    
     96
    8997#else
    9098    if (!setenv(pszVar, pszValue, 1))
    9199        return VINF_SUCCESS;
    92100    return RTErrConvertFromErrno(errno);
    93 #endif 
     101#endif
    94102}
    95103
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette