Changeset 35690 in vbox for trunk/src/VBox/Additions/common/VBoxService
- Timestamp:
- Jan 24, 2011 4:16:38 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/common/VBoxService/VBoxServiceControlExec.cpp
r35674 r35690 64 64 { 65 65 int rc2 = RTPollSetRemove(hPollSet, VBOXSERVICECTRLPIPEID_STDIN_WRITABLE); 66 AssertRC(rc2); 66 /* Don't assert if writable handle is not in poll set anymore. */ 67 if ( RT_FAILURE(rc2) 68 && rc2 != VERR_POLL_HANDLE_ID_NOT_FOUND) 69 { 70 AssertRC(rc2); 71 } 67 72 68 73 rc2 = RTPipeClose(*phStdInW); … … 209 214 rc = VBoxServiceControlExecProcHandleStdInErrorEvent(hPollSet, fPollEvt, phStdInW, pStdInBuf); 210 215 } 216 else if (!*pcbWritten) 217 { 218 /* Nothing else left to write now? Remove the writable event from the poll set 219 * to not trigger too high CPU loads. */ 220 rc = RTPollSetRemove(hPollSet, VBOXSERVICECTRLPIPEID_STDIN_WRITABLE); 221 AssertRC(rc); 222 } 211 223 } 212 224 else … … 388 400 if (RT_SUCCESS(rc2)) 389 401 { 390 #ifdef DEBUG391 402 VBoxServiceVerbose(4, "ControlExec: RTPollNoResume idPollHnd=%u\n", idPollHnd); 392 #endif393 403 switch (idPollHnd) 394 404 { … … 402 412 uint8_t abBuf[8]; 403 413 size_t cbIgnore; 404 RTPipeRead(pData->stdIn.hNotificationPipeR, abBuf, sizeof(abBuf), &cbIgnore); 414 rc = RTPipeRead(pData->stdIn.hNotificationPipeR, abBuf, sizeof(abBuf), &cbIgnore); 415 if (RT_SUCCESS(rc)) 416 { 417 /* 418 * When the writable handle previously was removed from the poll set we need to add 419 * it here again so that writable events from the started procecss get handled correctly. 420 */ 421 RTHANDLE hWritableIgnored; 422 rc = RTPollSetQueryHandle(hPollSet, VBOXSERVICECTRLPIPEID_STDIN_WRITABLE, &hWritableIgnored); 423 if (rc == VERR_POLL_HANDLE_ID_NOT_FOUND) 424 { 425 rc = RTPollSetAddPipe(hPollSet, pData->pipeStdInW, RTPOLL_EVT_WRITE, VBOXSERVICECTRLPIPEID_STDIN_WRITABLE); 426 AssertRC(rc); 427 break; 428 } 429 AssertRC(rc); 430 } 405 431 } 406 432 /* Fall through. */ … … 632 658 static int VBoxServiceControlExecSetupPipe(int fd, PRTHANDLE ph, PRTHANDLE *pph, PRTPIPE phPipe) 633 659 { 634 AssertPtr (ph);635 AssertPtr (pph);636 AssertPtr (phPipe);660 AssertPtrReturn(ph, VERR_INVALID_PARAMETER); 661 AssertPtrReturn(pph, VERR_INVALID_PARAMETER); 662 AssertPtrReturn(phPipe, VERR_INVALID_PARAMETER); 637 663 638 664 ph->enmType = RTHANDLETYPE_PIPE; … … 677 703 static int VBoxServiceControlExecInitPipeBuffer(PVBOXSERVICECTRLEXECPIPEBUF pBuf, bool fNeedNotificationPipe) 678 704 { 679 AssertPtr (pBuf);705 AssertPtrReturn(pBuf, VERR_INVALID_PARAMETER); 680 706 681 707 /** @todo Add allocation size as function parameter! */
Note:
See TracChangeset
for help on using the changeset viewer.