Changeset 1495 in vbox
- Timestamp:
- Mar 15, 2007 1:19:30 AM (18 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/COMDefs.cpp
r1473 r1495 65 65 #undef ASSERT 66 66 #include <VBox/com/assert.h> 67 #include <iprt/env.h> 68 #include <iprt/path.h> 69 #include <iprt/param.h> 70 #include <iprt/err.h> 67 71 68 72 nsIComponentManager *COMBase::gComponentManager = nsnull; … … 137 141 LogFlowFuncLeave(); 138 142 return S_OK; 143 } 144 145 /* 146 * Set VBOX_XPCOM_HOME if not present like we do in the common glue code. 147 * (XPCOMGlueStartup will query this.) 148 */ 149 if (!RTEnvExist ("VBOX_XPCOM_HOME")) 150 { 151 /* get the executable path */ 152 char szPathProgram [RTPATH_MAX]; 153 int rcVBox = RTPathProgram (szPathProgram, sizeof (szPathProgram)); 154 if (RT_SUCCESS (rcVBox)) 155 RTEnvSet ("VBOX_XPCOM_HOME", szPathProgram); 139 156 } 140 157 -
trunk/src/VBox/Frontends/VirtualBox/src/main.cpp
r1435 r1495 112 112 } 113 113 114 #ifdef __DARWIN__115 #include <iprt/path.h>116 #include <iprt/process.h>117 #include <iprt/env.h>118 119 /**120 * App bundle tweaks.121 */122 static void DarwinInit (void)123 {124 /* This probably belongs else where. */125 static struct126 {127 char var[sizeof ("VBOX_XPCOM_HOME=") - 1];128 char path[RTPATH_MAX];129 } s;130 131 strcpy (s.var, "VBOX_XPCOM_HOME=");132 int rc = RTPathProgram (&s.path[0], sizeof (s.path));133 if (RT_FAILURE (rc))134 {135 RTPrintf ("RTPathProgram failed!\n");136 exit (1);137 }138 139 if (!RTEnvGet ("VBOX_XPCOM_HOME"))140 RTEnvPut (s.var);141 142 /** @todo automatically start VBoxSVC. */143 }144 145 #endif146 147 148 114 int main( int argc, char ** argv ) 149 115 { … … 162 128 sigaction (SIGBUS, &sa, NULL); 163 129 sigaction (SIGUSR1, &sa, NULL); 164 #endif165 166 #ifdef __DARWIN__167 DarwinInit();168 130 #endif 169 131
Note:
See TracChangeset
for help on using the changeset viewer.