VirtualBox

Changeset 17813 in vbox for trunk/src/VBox/Main


Ignore:
Timestamp:
Mar 13, 2009 12:22:52 PM (16 years ago)
Author:
vboxsync
Message:

Cbinding: integrated the glue code in libvirt so that
the files are exact copies in vbox and libvirt.

Location:
trunk/src/VBox/Main/cbinding
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/cbinding/VBoxXPCOMCGlue.c

    r17677 r17813  
    5252#endif
    5353
    54 
    55 /*******************************************************************************
    56 *   Defined Constants And Macros                                               *
    57 *******************************************************************************/
    5854/** The dlopen handle for VBoxXPCOMC. */
    5955void *g_hVBoxXPCOMC = NULL;
     
    7268 * @returns 0 on success, -1 on failure.
    7369 * @param   pszHome         The director where to try load VBoxXPCOMC from. Can be NULL.
    74  * @param   pszMsgPrefix    Error message prefix. NULL means no error messages.
    7570 */
    76 static int tryLoadOne(const char *pszHome, const char *pszMsgPrefix)
     71static int tryLoadOne(const char *pszHome)
    7772{
    7873    size_t      cchHome = pszHome ? strlen(pszHome) : 0;
     
    8984    {
    9085        sprintf(g_szVBoxErrMsg, "malloc(%u) failed", (unsigned)cbBuf);
    91         if (pszMsgPrefix)
    92             fprintf(stderr, "%s%s\n", pszMsgPrefix, g_szVBoxErrMsg);
    9386        return -1;
    9487    }
     
    143136 *
    144137 * @returns 0 on success, -1 on failure.
    145  * @param   pszMsgPrefix    Error message prefix. NULL means no error messages.
    146138 *
    147139 * @remark  This should be considered moved into a separate glue library since
     
    150142 *          source code all around the place.
    151143 */
    152 int VBoxCGlueInit(const char *pszMsgPrefix)
     144int VBoxCGlueInit(void)
    153145{
    154146    /*
     
    157149    const char *pszHome = getenv("VBOX_APP_HOME");
    158150    if (pszHome)
    159         return tryLoadOne(pszHome, pszMsgPrefix);
     151        return tryLoadOne(pszHome);
    160152
    161153    /*
     
    163155     */
    164156#if defined(__gnu__linux__) || defined(__linux__)
    165     if (tryLoadOne("/opt/VirtualBox", pszMsgPrefix) == 0)
     157    if (tryLoadOne("/opt/VirtualBox") == 0)
    166158        return 0;
    167     if (tryLoadOne("/usr/lib/virtualbox", pszMsgPrefix) == 0)
     159    if (tryLoadOne("/usr/lib/virtualbox") == 0)
    168160        return 0;
    169161#elif defined(__sun__)
    170     if (tryLoadOne("/opt/VirtualBox/amd64", pszMsgPrefix) == 0)
     162    if (tryLoadOne("/opt/VirtualBox/amd64") == 0)
    171163        return 0;
    172     if (tryLoadOne("/opt/VirtualBox/i386", pszMsgPrefix) == 0)
     164    if (tryLoadOne("/opt/VirtualBox/i386") == 0)
    173165        return 0;
    174166#elif defined(__APPLE__)
     
    182174     * Finally try the dynamic linker search path.
    183175     */
    184     if (tryLoadOne(NULL, pszMsgPrefix) == 0)
     176    if (tryLoadOne(NULL) == 0)
    185177        return 0;
    186178
    187179    /* No luck, return failure. */
    188     if (pszMsgPrefix)
    189         fprintf(stderr, "%sFailed to locate VBoxXPCOMC\n", pszMsgPrefix);
    190180    return -1;
    191181}
    192 
    193182
    194183/**
     
    204193    g_pVBoxFuncs = NULL;
    205194    g_pfnGetFunctions = NULL;
     195    memset(g_szVBoxErrMsg, 0, sizeof(g_szVBoxErrMsg));
    206196}
    207 
  • trunk/src/VBox/Main/cbinding/VBoxXPCOMCGlue.h

    r17793 r17813  
    4848
    4949
    50 int VBoxCGlueInit(const char *pszMsgPrefix);
     50int VBoxCGlueInit(void);
    5151void VBoxCGlueTerm(void);
    5252
  • trunk/src/VBox/Main/cbinding/tstXPCOMCGlue.c

    r17737 r17813  
    319319     */
    320320
    321     if (VBoxCGlueInit(NULL) != 0)
     321    if (VBoxCGlueInit() != 0)
    322322    {
    323323        fprintf(stderr, "%s: FATAL: VBoxCGlueInit failed: %s\n",
Note: See TracChangeset for help on using the changeset viewer.

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