VirtualBox

Changeset 19052 in vbox


Ignore:
Timestamp:
Apr 21, 2009 9:13:46 AM (16 years ago)
Author:
vboxsync
Message:

VBoxXPCOMCGlue.c: dlopen errors are less important than the other ones.

File:
1 edited

Legend:

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

    r19028 r19052  
    7171 * Wrapper for setting g_szVBoxErrMsg. Can be an empty stub.
    7272 *
     73 * @param   fAlways         When 0 the g_szVBoxErrMsg is only set if empty.
    7374 * @param   pszFormat       The format string.
    7475 * @param   ...             The arguments.
    7576 */
    76 static void setErrMsg(const char *pszFormat, ...)
    77 {
    78     va_list va;
    79     va_start(va, pszFormat);
    80     vsnprintf(g_szVBoxErrMsg, sizeof(g_szVBoxErrMsg), pszFormat, va);
    81     va_end(va);
     77static void setErrMsg(int fAlways, const char *pszFormat, ...)
     78{
     79    if (    fAlways
     80        ||  !g_szVBoxErrMsg[0])
     81    {
     82        va_list va;
     83        va_start(va, pszFormat);
     84        vsnprintf(g_szVBoxErrMsg, sizeof(g_szVBoxErrMsg), pszFormat, va);
     85        va_end(va);
     86    }
    8287}
    8388
     
    106111    if (cbBufNeeded > sizeof(szName))
    107112    {
    108         setErrMsg("path buffer too small: %u bytes needed",
     113        setErrMsg(1, "path buffer too small: %u bytes needed",
    109114                  (unsigned)cbBufNeeded);
    110115        return -1;
     
    145150
    146151            /* bail out */
    147             setErrMsg("%.80s: pfnGetFunctions(%#x) failed",
     152            setErrMsg(1, "%.80s: pfnGetFunctions(%#x) failed",
    148153                      szName, VBOX_XPCOMC_VERSION);
    149154        }
    150155        else
    151             setErrMsg("dlsym(%.80s/%.32s): %.128s",
     156            setErrMsg(1, "dlsym(%.80s/%.32s): %.128s",
    152157                      szName, VBOX_GET_XPCOMC_FUNCTIONS_SYMBOL_NAME, dlerror());
    153158        dlclose(g_hVBoxXPCOMC);
     
    155160    }
    156161    else
    157         setErrMsg("dlopen(%.80s): %.160s", szName, dlerror());
     162        setErrMsg(0, "dlopen(%.80s): %.160s", szName, dlerror());
    158163    return rc;
    159164}
     
    183188     * Try the known standard locations.
    184189     */
     190    g_szVBoxErrMsg[0] = '\0';
    185191#if defined(__gnu__linux__) || defined(__linux__)
    186192    if (tryLoadOne("/opt/VirtualBox", 1) == 0)
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