VirtualBox

Changeset 39462 in vbox


Ignore:
Timestamp:
Nov 29, 2011 5:49:01 PM (13 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
75110
Message:

VBoxService/GuestCtrl: Only close stdin when we really wrote all data of last block.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/common/VBoxService/VBoxServiceControlThread.cpp

    r39461 r39462  
    322322static int VBoxServiceControlThreadCloseStdIn(RTPOLLSET hPollSet, PRTPIPE phStdInW)
    323323{
     324    AssertPtrReturn(phStdInW, VERR_INVALID_POINTER);
     325
    324326    int rc = RTPollSetRemove(hPollSet, VBOXSERVICECTRLPIPEID_STDIN);
    325327    if (rc != VERR_POLL_HANDLE_ID_NOT_FOUND)
    326328        AssertRC(rc);
    327329
    328     rc = RTPipeClose(*phStdInW);
    329     AssertRC(rc);
    330     *phStdInW = NIL_RTPIPE;
     330    if (*phStdInW != NIL_RTPIPE)
     331    {
     332        rc = RTPipeClose(*phStdInW);
     333        AssertRC(rc);
     334        *phStdInW = NIL_RTPIPE;
     335    }
    331336
    332337    return rc;
     
    453458
    454459            size_t cbWritten = 0;
    455             if (*phStdInW != NIL_RTPIPE)
     460            if (   *phStdInW != NIL_RTPIPE
     461                && pRequest->cbData)
    456462            {
    457463                rcReq = RTPipeWrite(*phStdInW,
     
    466472             * the poll set.
    467473             */
    468             if (   pRequest->enmType == VBOXSERVICECTRLREQUEST_STDIN_WRITE_EOF)
     474            if (   pRequest->enmType == VBOXSERVICECTRLREQUEST_STDIN_WRITE_EOF
    469475                && pRequest->cbData  == cbWritten)
    470476            {
    471                     rc = VBoxServiceControlThreadCloseStdIn(hPollSet, phStdInW);
     477                rc = VBoxServiceControlThreadCloseStdIn(hPollSet, phStdInW);
    472478            }
    473479
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette