VirtualBox

Changeset 31584 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Aug 11, 2010 9:51:16 PM (14 years ago)
Author:
vboxsync
Message:

Try to fix burning builds

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/r3/socket.cpp

    r31582 r31584  
    760760    rtSocketErrorReset();
    761761#ifdef RT_OS_WINDOWS
    762     int    cbNow = cbBuffer >= INT_MAX/2 ? INT_MAX/2 : (int)cbBuffer;
    763 #else
    764     size_t cbNow = cbBuffer;
    765 #endif
    766     ssize_t cbRead = recv(pThis->hNative, pvBuffer, cbNow, MSG_NOSIGNAL);
     762    int cbNow = cbBuffer >= INT_MAX/2 ? INT_MAX/2 : (int)cbBuffer;
     763
     764    int cbRead = recv(pThis->hNative, pvBuffer, cbNow, MSG_NOSIGNAL);
     765    if (cbRead >= 0)
     766    {
     767        *pcbRead = cbRead;
     768        rc = VINF_SUCCESS;
     769    }
     770    else
     771        rc = rtSocketError();
     772
     773    if (rc == VERR_TRY_AGAIN)
     774        rc = VINF_TRY_AGAIN;
     775#else
     776    ssize_t cbRead = recv(pThis->hNative, pvBuffer, cbBuffer, MSG_NOSIGNAL);
    767777    if (cbRead >= 0)
    768778        *pcbRead = cbRead;
     
    773783    }
    774784    else
    775         rc = RTErrConvertFromErrno(errno);
     785        rc = rtSocketError();
     786#endif
    776787
    777788    rtSocketUnlock(pThis);
     
    797808    rtSocketErrorReset();
    798809#ifdef RT_OS_WINDOWS
    799     int    cbNow = RT_MIN((int)cbBuffer, INT_MAX/2);
    800 #else
    801     size_t cbNow = cbBuffer;
    802 #endif
    803     ssize_t cbWritten = send(pThis->hNative, pvBuffer, cbNow, MSG_NOSIGNAL);
     810    int cbNow = RT_MIN((int)cbBuffer, INT_MAX/2);
     811
     812    int cbWritten = send(pThis->hNative, pvBuffer, cbNow, MSG_NOSIGNAL);
     813
     814    if (cbWritten >= 0)
     815    {
     816        *pcbWritten = cbWritten;
     817        rc = VINF_SUCCESS;
     818    }
     819    else
     820        rc = rtSocketError();
     821
     822    if (rc == VERR_TRY_AGAIN)
     823        rc = VINF_TRY_AGAIN;
     824#else
     825    ssize_t cbWritten = send(pThis->hNative, pvBuffer, cbBuffer, MSG_NOSIGNAL);
    804826    if (cbWritten >= 0)
    805827        *pcbWritten = cbWritten;
     
    810832    }
    811833    else
    812         rc = RTErrConvertFromErrno(errno);
     834        rc = rtSocketError();
     835#endif
    813836
    814837    rtSocketUnlock(pThis);
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