- Timestamp:
- Feb 11, 2009 7:10:56 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/cbinding/tstLinuxC.c
r16684 r16688 25 25 #include <string.h> 26 26 #include <stdlib.h> 27 #include <sys/stat.h> 27 28 #include "cbinding.h" 28 29 … … 301 302 { 302 303 IVirtualBox *vbox = NULL; 303 ISession *session = NULL; 304 PRUint32 revision = 0; 305 PRUnichar *versionUtf16 = NULL; 306 PRUnichar *homefolderUtf16 = NULL; 307 nsresult rc; /* Result code of various function (method) calls. */ 308 FILE *fpsetenv; 309 310 if ((fpsetenv = fopen("/opt/VirtualBox/VBoxXPCOMC.so", "r")) != NULL) { 311 VBoxSetEnv("VBOX_APP_HOME","/opt/VirtualBox/"); 312 fclose (fpsetenv); 313 } 314 if ((fpsetenv = fopen("/usr/lib/virtualbox/VBoxXPCOMC.so", "r")) != NULL) { 315 VBoxSetEnv("VBOX_APP_HOME","/usr/lib/virtualbox/"); 316 fclose (fpsetenv); 304 ISession *session = NULL; 305 PRUint32 revision = 0; 306 PRUnichar *versionUtf16 = NULL; 307 PRUnichar *homefolderUtf16 = NULL; 308 struct stat stIgnored; 309 nsresult rc; /* Result code of various function (method) calls. */ 310 311 /* 312 * Guess where VirtualBox is installed not mentioned in the environment. 313 * (This will be moved to VBoxComInitialize later.) 314 */ 315 316 if (!VBoxGetEnv("VBOX_APP_HOME")) 317 { 318 if (stat("/opt/VirtualBox/VBoxXPCOMC.so", &stIgnored) == 0) 319 { 320 VBoxSetEnv("VBOX_APP_HOME","/opt/VirtualBox/"); 321 } 322 if (stat("/usr/lib/virtualbox/VBoxXPCOMC.so", &stIgnored) == 0) 323 { 324 VBoxSetEnv("VBOX_APP_HOME","/usr/lib/virtualbox/"); 325 } 317 326 } 318 327 … … 335 344 if (session == NULL) 336 345 { 337 fprintf 346 fprintf(stderr, "%s: FATAL: could not get session handle\n", argv[0]); 338 347 return EXIT_FAILURE; 339 348 }
Note:
See TracChangeset
for help on using the changeset viewer.