Changeset 60980 in vbox for trunk/src/VBox/Additions/x11
- Timestamp:
- May 13, 2016 5:08:19 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/x11/VBoxClient/main.cpp
r58993 r60980 270 270 { 271 271 vboxClientUsage(pcszFileName); 272 return 0;272 return RTEXITCODE_SUCCESS; 273 273 } 274 274 else if (!strcmp(argv[i], "-V") || !strcmp(argv[i], "--version")) 275 275 { 276 276 RTPrintf("%sr%s\n", RTBldCfgVersion(), RTBldCfgRevisionStr()); 277 return 0;277 return RTEXITCODE_SUCCESS; 278 278 } 279 279 else … … 281 281 RTPrintf("%s: unrecognized option `%s'\n", pcszFileName, argv[i]); 282 282 RTPrintf("Try `%s --help' for more information\n", pcszFileName); 283 return 1;283 return RTEXITCODE_SYNTAX; 284 284 } 285 285 rc = VINF_SUCCESS; … … 288 288 { 289 289 vboxClientUsage(pcszFileName); 290 return 1;290 return RTEXITCODE_SYNTAX; 291 291 } 292 292 293 293 rc = RTCritSectInit(&g_critSect); 294 294 if (RT_FAILURE(rc)) 295 VBClFatalError(("Initialising critical section : %Rrc\n", rc));295 VBClFatalError(("Initialising critical section failed: %Rrc\n", rc)); 296 296 if ((*g_pService)->getPidFilePath) 297 297 { 298 298 rc = RTPathUserHome(g_szPidFile, sizeof(g_szPidFile)); 299 299 if (RT_FAILURE(rc)) 300 VBClFatalError(("Getting home directory for pid-file: %Rrc\n", rc));300 VBClFatalError(("Getting home directory for PID file failed: %Rrc\n", rc)); 301 301 rc = RTPathAppend(g_szPidFile, sizeof(g_szPidFile), 302 302 (*g_pService)->getPidFilePath()); 303 303 if (RT_FAILURE(rc)) 304 VBClFatalError(("Creating pid-file path: %Rrc\n", rc));304 VBClFatalError(("Creating PID file path failed: %Rrc\n", rc)); 305 305 if (fDaemonise) 306 306 rc = VbglR3Daemonize(false /* fNoChDir */, false /* fNoClose */, fRespawn, &cRespawn); 307 307 if (RT_FAILURE(rc)) 308 VBClFatalError(("Daemonizing : %Rrc\n", rc));308 VBClFatalError(("Daemonizing failed: %Rrc\n", rc)); 309 309 if (g_szPidFile[0]) 310 310 rc = VbglR3PidFile(g_szPidFile, &g_hPidFile); 311 311 if (rc == VERR_FILE_LOCK_VIOLATION) /* Already running. */ 312 return 0;313 if (RT_FAILURE(rc)) 314 VBClFatalError(("Creating pid-file: %Rrc\n", rc));312 return RTEXITCODE_SUCCESS; 313 if (RT_FAILURE(rc)) 314 VBClFatalError(("Creating PID file failed: %Rrc\n", rc)); 315 315 } 316 316 /* Set signal handlers to clean up on exit. */ … … 325 325 #endif 326 326 rc = (*g_pService)->init(g_pService); 327 if (RT_FAILURE(rc)) 328 VBClFatalError(("Initialising service: %Rrc\n", rc)); 329 rc = (*g_pService)->run(g_pService, fDaemonise); 330 if (RT_FAILURE(rc)) 331 VBClFatalError(("Service main loop failed: %Rrc\n", rc)); 327 if (RT_SUCCESS(rc)) 328 { 329 rc = (*g_pService)->run(g_pService, fDaemonise); 330 if (RT_FAILURE(rc)) 331 LogRel2(("Running service failed: %Rrc\n", rc)); 332 } 333 else 334 { 335 /** @todo r=andy Should we return an appropriate exit code if the service failed to init? 336 * Must be tested carefully with our init scripts first. */ 337 LogRel2(("Initializing service failed: %Rrc\n", rc)); 338 } 332 339 VBClCleanUp(); 333 return 0; 334 } 340 return RTEXITCODE_SUCCESS; 341 } 342
Note:
See TracChangeset
for help on using the changeset viewer.