Changeset 17813 in vbox for trunk/src/VBox/Main
- Timestamp:
- Mar 13, 2009 12:22:52 PM (16 years ago)
- Location:
- trunk/src/VBox/Main/cbinding
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/cbinding/VBoxXPCOMCGlue.c
r17677 r17813 52 52 #endif 53 53 54 55 /*******************************************************************************56 * Defined Constants And Macros *57 *******************************************************************************/58 54 /** The dlopen handle for VBoxXPCOMC. */ 59 55 void *g_hVBoxXPCOMC = NULL; … … 72 68 * @returns 0 on success, -1 on failure. 73 69 * @param pszHome The director where to try load VBoxXPCOMC from. Can be NULL. 74 * @param pszMsgPrefix Error message prefix. NULL means no error messages.75 70 */ 76 static int tryLoadOne(const char *pszHome , const char *pszMsgPrefix)71 static int tryLoadOne(const char *pszHome) 77 72 { 78 73 size_t cchHome = pszHome ? strlen(pszHome) : 0; … … 89 84 { 90 85 sprintf(g_szVBoxErrMsg, "malloc(%u) failed", (unsigned)cbBuf); 91 if (pszMsgPrefix)92 fprintf(stderr, "%s%s\n", pszMsgPrefix, g_szVBoxErrMsg);93 86 return -1; 94 87 } … … 143 136 * 144 137 * @returns 0 on success, -1 on failure. 145 * @param pszMsgPrefix Error message prefix. NULL means no error messages.146 138 * 147 139 * @remark This should be considered moved into a separate glue library since … … 150 142 * source code all around the place. 151 143 */ 152 int VBoxCGlueInit( const char *pszMsgPrefix)144 int VBoxCGlueInit(void) 153 145 { 154 146 /* … … 157 149 const char *pszHome = getenv("VBOX_APP_HOME"); 158 150 if (pszHome) 159 return tryLoadOne(pszHome , pszMsgPrefix);151 return tryLoadOne(pszHome); 160 152 161 153 /* … … 163 155 */ 164 156 #if defined(__gnu__linux__) || defined(__linux__) 165 if (tryLoadOne("/opt/VirtualBox" , pszMsgPrefix) == 0)157 if (tryLoadOne("/opt/VirtualBox") == 0) 166 158 return 0; 167 if (tryLoadOne("/usr/lib/virtualbox" , pszMsgPrefix) == 0)159 if (tryLoadOne("/usr/lib/virtualbox") == 0) 168 160 return 0; 169 161 #elif defined(__sun__) 170 if (tryLoadOne("/opt/VirtualBox/amd64" , pszMsgPrefix) == 0)162 if (tryLoadOne("/opt/VirtualBox/amd64") == 0) 171 163 return 0; 172 if (tryLoadOne("/opt/VirtualBox/i386" , pszMsgPrefix) == 0)164 if (tryLoadOne("/opt/VirtualBox/i386") == 0) 173 165 return 0; 174 166 #elif defined(__APPLE__) … … 182 174 * Finally try the dynamic linker search path. 183 175 */ 184 if (tryLoadOne(NULL , pszMsgPrefix) == 0)176 if (tryLoadOne(NULL) == 0) 185 177 return 0; 186 178 187 179 /* No luck, return failure. */ 188 if (pszMsgPrefix)189 fprintf(stderr, "%sFailed to locate VBoxXPCOMC\n", pszMsgPrefix);190 180 return -1; 191 181 } 192 193 182 194 183 /** … … 204 193 g_pVBoxFuncs = NULL; 205 194 g_pfnGetFunctions = NULL; 195 memset(g_szVBoxErrMsg, 0, sizeof(g_szVBoxErrMsg)); 206 196 } 207 -
trunk/src/VBox/Main/cbinding/VBoxXPCOMCGlue.h
r17793 r17813 48 48 49 49 50 int VBoxCGlueInit( const char *pszMsgPrefix);50 int VBoxCGlueInit(void); 51 51 void VBoxCGlueTerm(void); 52 52 -
trunk/src/VBox/Main/cbinding/tstXPCOMCGlue.c
r17737 r17813 319 319 */ 320 320 321 if (VBoxCGlueInit( NULL) != 0)321 if (VBoxCGlueInit() != 0) 322 322 { 323 323 fprintf(stderr, "%s: FATAL: VBoxCGlueInit failed: %s\n",
Note:
See TracChangeset
for help on using the changeset viewer.