VirtualBox

Changeset 35244 in vbox


Ignore:
Timestamp:
Dec 20, 2010 1:46:17 PM (14 years ago)
Author:
vboxsync
Message:

Additions/VBoxService: allow to cat files with size 0 to the guest

Location:
trunk/src/VBox/Additions/common/VBoxService
Files:
2 edited

Legend:

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

    r35012 r35244  
    16181618        VBoxServiceError("ControlExec: Failed to retrieve exec input command! Error: %Rrc\n", rc);
    16191619    }
    1620     else if (   cbSize <= 0
    1621              || cbSize >  cbMaxBufSize)
     1620    else if (cbSize >  cbMaxBufSize)
    16221621    {
    16231622        VBoxServiceError("ControlExec: Input size is invalid! cbSize=%u\n", cbSize);
     
    16611660            if (RT_SUCCESS(rc))
    16621661            {
    1663                 if (cbWritten) /* Did we write something? */
     1662                if (cbWritten || !cbSize) /* Did we write something or was there anything to write at all? */
    16641663                {
    16651664                    uStatus = INPUT_STS_WRITTEN;
  • trunk/src/VBox/Additions/common/VBoxService/VBoxServiceToolBox.cpp

    r34777 r35244  
    186186        {
    187187            rc = RTFileRead(hInput, abBuf, sizeof(abBuf), &cbRead);
    188             if (RT_SUCCESS(rc) && cbRead)
     188            if (RT_SUCCESS(rc))
    189189            {
    190190                rc = RTFileWrite(hOutput, abBuf, cbRead, NULL /* Try to write all at once! */);
     
    193193            else
    194194            {
    195                 if (   cbRead == 0
    196                     && rc     == VERR_BROKEN_PIPE)
    197                 {
     195                if (rc == VERR_BROKEN_PIPE)
    198196                    rc = VINF_SUCCESS;
    199                 }
    200197                break;
    201198            }
Note: See TracChangeset for help on using the changeset viewer.

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