Changeset 55580 in vbox for trunk/src/VBox/Additions/common/VBoxService
- Timestamp:
- May 1, 2015 10:19:37 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/common/VBoxService/VBoxServiceControlSession.cpp
r55579 r55580 2267 2267 2268 2268 /** 2269 * Close all formerly opened guest session threads. 2270 * Note: Caller is responsible for locking! 2269 * Close all open guest session threads. 2270 * 2271 * @note Caller is responsible for locking! 2271 2272 * 2272 2273 * @return IPRT status code. … … 2284 2285 VBoxServiceError("Cancelling pending waits failed; rc=%Rrc\n", rc);*/ 2285 2286 2286 PVBOXSERVICECTRLSESSIONTHREAD pSessionThread 2287 2287 /** @todo r=bird: Why don't you use RTListForEachSafe here?? */ 2288 PVBOXSERVICECTRLSESSIONTHREAD pSessionThread = RTListGetFirst(pList, VBOXSERVICECTRLSESSIONTHREAD, Node); 2288 2289 while (pSessionThread) 2289 2290 { 2290 2291 PVBOXSERVICECTRLSESSIONTHREAD pSessionThreadNext = 2291 2292 RTListGetNext(pList, pSessionThread, VBOXSERVICECTRLSESSIONTHREAD, Node); 2292 bool fLast = RTListNodeIsLast(pList, &pSessionThread->Node); 2293 bool fLast = RTListNodeIsLast(pList, &pSessionThread->Node); /** @todo r=bird: This isn't necessary, pSessionThreadNext will be NULL! */ 2293 2294 2294 2295 int rc2 = GstCntlSessionThreadDestroy(pSessionThread, uFlags); … … 2310 2311 } 2311 2312 2313 /** @todo r=bird: This isn't a fork in the tranditional unix sense, so please 2314 * don't confuse any unix guys by using the term. 2315 * GstCntlSessionChildMain would be a good name. */ 2312 2316 RTEXITCODE VBoxServiceControlSessionForkInit(int argc, char **argv) 2313 2317 { … … 2341 2345 g_Session.StartupInfo.uSessionID = UINT32_MAX; 2342 2346 2343 int rc = VINF_SUCCESS; 2344 2345 while ( (ch = RTGetOpt(&GetState, &ValueUnion)) 2346 && RT_SUCCESS(rc)) 2347 while ((ch = RTGetOpt(&GetState, &ValueUnion)) != 0) 2347 2348 { 2348 2349 /* For options that require an argument, ValueUnion has received the value. */ … … 2350 2351 { 2351 2352 case VBOXSERVICESESSIONOPT_LOG_FILE: 2352 rc = RTStrCopy(g_szLogFile, sizeof(g_szLogFile), ValueUnion.psz); 2353 { 2354 int rc = RTStrCopy(g_szLogFile, sizeof(g_szLogFile), ValueUnion.psz); 2353 2355 if (RT_FAILURE(rc)) 2354 2356 return RTMsgErrorExit(RTEXITCODE_FAILURE, "Error copying log file name: %Rrc", rc); 2355 2357 break; 2358 } 2356 2359 #ifdef DEBUG 2357 2360 case VBOXSERVICESESSIONOPT_DUMP_STDOUT: … … 2364 2367 #endif 2365 2368 case VBOXSERVICESESSIONOPT_USERNAME: 2366 /* * @todoInformation not needed right now, skip. */2369 /* Information not needed right now, skip. */ 2367 2370 break; 2368 2371 … … 2377 2380 #ifdef DEBUG 2378 2381 case VBOXSERVICESESSIONOPT_THREAD_ID: 2379 /* Not handled. */2382 /* Not handled. Mainly for processs listing. */ 2380 2383 break; 2381 2384 #endif … … 2388 2391 case VINF_GETOPT_NOT_OPTION: 2389 2392 /* Ignore; might be "guestsession" main command. */ 2393 /** @todo r=bird: We DO NOT ignore stuff on the command line! */ 2390 2394 break; 2391 2395 2392 2396 default: 2393 2397 return RTMsgErrorExit(RTEXITCODE_SYNTAX, "Unknown command '%s'", ValueUnion.psz); 2394 break; /* Never reached. */ 2395 } 2396 } 2397 2398 if (RT_FAILURE(rc)) 2399 return RTMsgErrorExit(RTEXITCODE_FAILURE, "Initialization failed with rc=%Rrc", rc); 2400 2398 } 2399 } 2400 2401 /* Check that we've got all the required options. */ 2401 2402 if (g_Session.StartupInfo.uProtocol == UINT32_MAX) 2402 2403 return RTMsgErrorExit(RTEXITCODE_SYNTAX, "No protocol version specified"); … … 2406 2407 2407 2408 /* Init the session object. */ 2408 rc = GstCntlSessionInit(&g_Session, uSessionFlags);2409 int rc = GstCntlSessionInit(&g_Session, uSessionFlags); 2409 2410 if (RT_FAILURE(rc)) 2410 2411 return RTMsgErrorExit(RTEXITCODE_INIT, "Failed to initialize session object, rc=%Rrc\n", rc); 2411 2412 2412 rc = VBoxServiceLogCreate( strlen(g_szLogFile)? g_szLogFile : NULL);2413 rc = VBoxServiceLogCreate(g_szLogFile[0] ? g_szLogFile : NULL); 2413 2414 if (RT_FAILURE(rc)) 2414 2415 return RTMsgErrorExit(RTEXITCODE_INIT, "Failed to create log file \"%s\", rc=%Rrc\n", 2415 strlen(g_szLogFile)? g_szLogFile : "<None>", rc);2416 g_szLogFile[0] ? g_szLogFile : "<None>", rc); 2416 2417 2417 2418 RTEXITCODE rcExit = gstcntlSessionForkWorker(&g_Session);
Note:
See TracChangeset
for help on using the changeset viewer.