Changeset 29041 in vbox for trunk/src/VBox
- Timestamp:
- May 4, 2010 8:13:41 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/common/VBoxService/VBoxServiceControlExec.cpp
r28943 r29041 178 178 if (RT_FAILURE(rc)) 179 179 { 180 VBoxServiceError("Control : Error while sending real-time output data, rc=%Rrc, cbRead=%u, CID=%u, PID=%u\n",180 VBoxServiceError("ControlExec: Error while sending real-time output data, rc=%Rrc, cbRead=%u, CID=%u, PID=%u\n", 181 181 rc, cbRead, pThread->uClientID, pData->uPID); 182 182 } … … 274 274 * and that it's now OK to send input to the process. 275 275 */ 276 VBoxServiceVerbose(3, "Control : Process started: PID=%u, CID=%u, User=%s, PW=%s\n",276 VBoxServiceVerbose(3, "ControlExec: Process started: PID=%u, CID=%u, User=%s, PW=%s\n", 277 277 pData->uPID, pThread->uContextID, pData->pszUser, pData->pszPassword); 278 278 rc = VbglR3GuestCtrlExecReportStatus(pThread->uClientID, pThread->uContextID, … … 370 370 if (cMsElapsed >= cMillies) 371 371 { 372 VBoxServiceVerbose(3, "Control : Process timed out (%ums elapsed > %ums timeout), killing ...", cMsElapsed, cMillies);372 VBoxServiceVerbose(3, "ControlExec: Process timed out (%ums elapsed > %ums timeout), killing ...", cMsElapsed, cMillies); 373 373 374 374 fProcessTimedOut = true; … … 435 435 if ( fProcessTimedOut && !fProcessAlive && MsProcessKilled != UINT64_MAX) 436 436 { 437 VBoxServiceVerbose(3, "ControlExec: Process timed out and got killed\n"); 437 438 uStatus = PROC_STS_TOK; 438 439 } 439 440 else if (fProcessTimedOut && fProcessAlive && MsProcessKilled != UINT64_MAX) 440 441 { 442 VBoxServiceVerbose(3, "ControlExec: Process timed out and did *not* get killed\n"); 441 443 uStatus = PROC_STS_TOA; 442 444 } 443 445 else if (pThread->fShutdown && (fProcessAlive || MsProcessKilled != UINT64_MAX)) 444 446 { 447 VBoxServiceVerbose(3, "ControlExec: Process got terminated because system/service is going stopping\n"); 445 448 uStatus = PROC_STS_DWN; /* Service is stopping, process was killed. */ 446 449 } 447 450 else if (fProcessAlive) 448 451 { 449 VBoxServiceError("Control : Process is alive when it should not!\n");452 VBoxServiceError("ControlExec: Process is alive when it should not!\n"); 450 453 } 451 454 else if (MsProcessKilled != UINT64_MAX) 452 455 { 453 VBoxServiceError("Control : Process has been killed when it should not!\n");456 VBoxServiceError("ControlExec: Process has been killed when it should not!\n"); 454 457 } 455 458 else if (ProcessStatus.enmReason == RTPROCEXITREASON_NORMAL) 456 459 { 460 VBoxServiceVerbose(3, "ControlExec: Process ended with RTPROCEXITREASON_NORMAL\n"); 461 457 462 uStatus = PROC_STS_TEN; 458 463 uFlags = ProcessStatus.iStatus; … … 460 465 else if (ProcessStatus.enmReason == RTPROCEXITREASON_SIGNAL) 461 466 { 467 VBoxServiceVerbose(3, "ControlExec: Process ended with RTPROCEXITREASON_SIGNAL\n"); 468 462 469 uStatus = PROC_STS_TES; 463 470 uFlags = ProcessStatus.iStatus; … … 465 472 else if (ProcessStatus.enmReason == RTPROCEXITREASON_ABEND) 466 473 { 474 VBoxServiceVerbose(3, "ControlExec: Process ended with RTPROCEXITREASON_ABEND\n"); 475 467 476 uStatus = PROC_STS_TEA; 468 477 uFlags = ProcessStatus.iStatus; … … 470 479 else 471 480 { 472 VBoxServiceError("Control : Process has reached an undefined status!\n");473 } 474 475 VBoxServiceVerbose(3, "Control : Process ended: PID=%u, CID=%u, Status=%u, Flags=%u\n",481 VBoxServiceError("ControlExec: Process has reached an undefined status!\n"); 482 } 483 484 VBoxServiceVerbose(3, "ControlExec: Process ended: PID=%u, CID=%u, Status=%u, Flags=%u\n", 476 485 pData->uPID, pThread->uContextID, uStatus, uFlags); 477 486 rc = VbglR3GuestCtrlExecReportStatus(pThread->uClientID, pThread->uContextID, … … 480 489 } 481 490 RTMemFree(StdInBuf.pch); 482 VBoxServiceVerbose(3, "Control : Process loop ended with rc=%Rrc\n", rc);491 VBoxServiceVerbose(3, "ControlExec: Process loop ended with rc=%Rrc\n", rc); 483 492 return rc; 484 493 } … … 545 554 pBuf->cbRead = 0; 546 555 547 return RT SemMutexCreate(&pBuf->mtx);556 return RTCritSectInit(&pBuf->CritSect); 548 557 } 549 558 … … 559 568 pBuf->cbRead = 0; 560 569 } 561 return RT SemMutexDestroy(pBuf->mtx);570 return RTCritSectDelete(&pBuf->CritSect); 562 571 } 563 572 … … 568 577 AssertPtr(pcbToRead); 569 578 570 int rc = RT SemMutexRequest(pBuf->mtx, RT_INDEFINITE_WAIT);579 int rc = RTCritSectEnter(&pBuf->CritSect); 571 580 if (RT_SUCCESS(rc)) 572 581 { … … 588 597 *pcbToRead = 0; 589 598 } 590 rc = RT SemMutexRelease(pBuf->mtx);599 rc = RTCritSectLeave(&pBuf->CritSect); 591 600 } 592 601 return rc; … … 598 607 AssertPtr(pBuf); 599 608 600 int rc = RT SemMutexRequest(pBuf->mtx, RT_INDEFINITE_WAIT);609 int rc = RTCritSectEnter(&pBuf->CritSect); 601 610 if (RT_SUCCESS(rc)) 602 611 { … … 621 630 else 622 631 rc = VERR_NO_MEMORY; 623 int rc2 = RT SemMutexRelease(pBuf->mtx);632 int rc2 = RTCritSectLeave(&pBuf->CritSect); 624 633 if (RT_SUCCESS(rc)) 625 634 rc = rc2; … … 759 768 */ 760 769 RTThreadUserSignal(RTThreadSelf()); 761 VBoxServiceVerbose(3, "Control : Thread of process \"%s\" started\n", pData->pszCmd);770 VBoxServiceVerbose(3, "ControlExec: Thread of process \"%s\" started\n", pData->pszCmd); 762 771 763 772 int rc = VbglR3GuestCtrlConnect(&pThread->uClientID); 764 773 if (RT_FAILURE(rc)) 765 774 { 766 VBoxServiceError("Control : Thread failed to connect to the guest control service, aborted! Error: %Rrc\n", rc);775 VBoxServiceError("ControlExec: Thread failed to connect to the guest control service, aborted! Error: %Rrc\n", rc); 767 776 return rc; 768 777 } … … 863 872 NULL /* pvData */, 0 /* cbData */); 864 873 if (RT_FAILURE(rc2)) 865 VBoxServiceError("Control : Could not report process start error! Error: %Rrc (process error %Rrc)\n",874 VBoxServiceError("ControlExec: Could not report process start error! Error: %Rrc (process error %Rrc)\n", 866 875 rc2, rc); 867 876 } … … 882 891 883 892 VbglR3GuestCtrlDisconnect(pThread->uClientID); 884 VBoxServiceVerbose(3, "Control : Thread of process \"%s\" (PID: %u) ended with rc=%Rrc\n",893 VBoxServiceVerbose(3, "ControlExec: Thread of process \"%s\" (PID: %u) ended with rc=%Rrc\n", 885 894 pData->pszCmd, pData->uPID, rc); 886 895 return rc; … … 920 929 if (RT_FAILURE(rc)) 921 930 { 922 VBoxServiceError("Control : RTThreadCreate failed, rc=%Rrc\n, pThread=%p\n",931 VBoxServiceError("ControlExec: RTThreadCreate failed, rc=%Rrc\n, pThread=%p\n", 923 932 rc, pThread); 924 933 } … … 929 938 if (pThread->fShutdown) 930 939 { 931 VBoxServiceError("Control : Thread for process \"%s\" failed to start!\n", pszCmd);940 VBoxServiceError("ControlExec: Thread for process \"%s\" failed to start!\n", pszCmd); 932 941 rc = VERR_GENERAL_FAILURE; 933 942 }
Note:
See TracChangeset
for help on using the changeset viewer.