Changeset 19052 in vbox
- Timestamp:
- Apr 21, 2009 9:13:46 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/cbinding/VBoxXPCOMCGlue.c
r19028 r19052 71 71 * Wrapper for setting g_szVBoxErrMsg. Can be an empty stub. 72 72 * 73 * @param fAlways When 0 the g_szVBoxErrMsg is only set if empty. 73 74 * @param pszFormat The format string. 74 75 * @param ... The arguments. 75 76 */ 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); 77 static 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 } 82 87 } 83 88 … … 106 111 if (cbBufNeeded > sizeof(szName)) 107 112 { 108 setErrMsg( "path buffer too small: %u bytes needed",113 setErrMsg(1, "path buffer too small: %u bytes needed", 109 114 (unsigned)cbBufNeeded); 110 115 return -1; … … 145 150 146 151 /* bail out */ 147 setErrMsg( "%.80s: pfnGetFunctions(%#x) failed",152 setErrMsg(1, "%.80s: pfnGetFunctions(%#x) failed", 148 153 szName, VBOX_XPCOMC_VERSION); 149 154 } 150 155 else 151 setErrMsg( "dlsym(%.80s/%.32s): %.128s",156 setErrMsg(1, "dlsym(%.80s/%.32s): %.128s", 152 157 szName, VBOX_GET_XPCOMC_FUNCTIONS_SYMBOL_NAME, dlerror()); 153 158 dlclose(g_hVBoxXPCOMC); … … 155 160 } 156 161 else 157 setErrMsg( "dlopen(%.80s): %.160s", szName, dlerror());162 setErrMsg(0, "dlopen(%.80s): %.160s", szName, dlerror()); 158 163 return rc; 159 164 } … … 183 188 * Try the known standard locations. 184 189 */ 190 g_szVBoxErrMsg[0] = '\0'; 185 191 #if defined(__gnu__linux__) || defined(__linux__) 186 192 if (tryLoadOne("/opt/VirtualBox", 1) == 0)
Note:
See TracChangeset
for help on using the changeset viewer.