Changeset 103285 in vbox for trunk/src/VBox/Main/src-server/xpcom/server_module.cpp
- Timestamp:
- Feb 8, 2024 3:27:12 PM (12 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-server/xpcom/server_module.cpp
r103275 r103285 75 75 76 76 /** Name of the server executable. */ 77 const char VBoxSVC_exe[] = RTPATH_SLASH_STR "VBoxSVC" HOSTSUFF_EXE;77 const char g_szVBoxSVC_exe[] = RTPATH_SLASH_STR "VBoxSVC" HOSTSUFF_EXE; 78 78 79 79 enum … … 88 88 * Full path to the VBoxSVC executable. 89 89 */ 90 static char VBoxSVCPath[RTPATH_MAX];91 static bool IsVBoxSVCPathSet = false;90 static char g_szVBoxSVCPath[RTPATH_MAX]; 91 static bool g_fIsVBoxSVCPathSet = false; 92 92 93 93 /* … … 116 116 const char *apszArgs[] = 117 117 { 118 VBoxSVCPath,118 g_szVBoxSVCPath, 119 119 "--auto-shutdown", 120 120 "--inherit-startup-pipe", … … 132 132 hStdNil.u.hFile = NIL_RTFILE; 133 133 134 vrc = RTProcCreateEx( VBoxSVCPath, apszArgs, RTENV_DEFAULT,134 vrc = RTProcCreateEx(g_szVBoxSVCPath, apszArgs, RTENV_DEFAULT, 135 135 RTPROC_FLAGS_DETACHED, &hStdNil, &hStdNil, &hStdNil, 136 136 NULL /* pszAsUser */, NULL /* pszPassword */, NULL /* pExtraData */, … … 187 187 } 188 188 189 if (! IsVBoxSVCPathSet)189 if (!g_fIsVBoxSVCPathSet) 190 190 { 191 191 /* Get the directory containing XPCOM components -- the VBoxSVC … … 204 204 205 205 LogFlowFunc(("component directory = \"%s\"\n", path.get())); 206 AssertBreakStmt(path.Length() + strlen( VBoxSVC_exe) < RTPATH_MAX,206 AssertBreakStmt(path.Length() + strlen(g_szVBoxSVC_exe) < RTPATH_MAX, 207 207 rc = NS_ERROR_FAILURE); 208 208 … … 212 212 if (cbKernArch > 0) 213 213 { 214 sprintf( VBoxSVCPath, "/opt/VirtualBox/%s%s", achKernArch,VBoxSVC_exe);215 IsVBoxSVCPathSet = true;214 sprintf(g_szVBoxSVCPath, "/opt/VirtualBox/%s%s", achKernArch, g_szVBoxSVC_exe); 215 g_fIsVBoxSVCPathSet = true; 216 216 } 217 217 else 218 218 rc = NS_ERROR_UNEXPECTED; 219 219 #else 220 strcpy(VBoxSVCPath, path.get()); 221 RTPathStripFilename(VBoxSVCPath); 222 strcat(VBoxSVCPath, VBoxSVC_exe); 223 224 IsVBoxSVCPathSet = true; 220 int vrc = RTStrCopy(g_szVBoxSVCPath, sizeof(g_szVBoxSVCPath), path.get()); 221 AssertRCBreakStmt(vrc, rc = NS_ERROR_FAILURE); 222 RTPathStripFilename(g_szVBoxSVCPath); 223 vrc = RTStrCat(g_szVBoxSVCPath, sizeof(g_szVBoxSVCPath), g_szVBoxSVC_exe); 224 AssertRCBreakStmt(vrc, rc = NS_ERROR_FAILURE); 225 226 g_fIsVBoxSVCPathSet = true; 225 227 #endif 226 228 } … … 247 249 if (NS_FAILED(rc)) 248 250 { 249 LogFlowFunc(("Starting server \"%s\"...\n", VBoxSVCPath));251 LogFlowFunc(("Starting server \"%s\"...\n", g_szVBoxSVCPath)); 250 252 251 253 startedOnce = true;
Note:
See TracChangeset
for help on using the changeset viewer.