- Timestamp:
- Aug 16, 2018 6:09:40 PM (7 years ago)
- svn:sync-xref-src-repo-rev:
- 124401
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Serial/DrvCharNew.cpp
r73713 r73722 250 250 } 251 251 252 size_t cbProcessed = pThis->cbTxUsed; 253 rc = pThis->pDrvStream->pfnWrite(pThis->pDrvStream, &pThis->abTxBuf[0], &cbProcessed); 254 if (RT_SUCCESS(rc)) 252 if (pThis->cbTxUsed) 255 253 { 256 pThis->cbTxUsed -= cbProcessed; 257 if (pThis->cbTxUsed) 254 size_t cbProcessed = pThis->cbTxUsed; 255 rc = pThis->pDrvStream->pfnWrite(pThis->pDrvStream, &pThis->abTxBuf[0], &cbProcessed); 256 if (RT_SUCCESS(rc)) 258 257 { 259 /* Move the data in the TX buffer to the front to fill the end again. */ 260 memmove(&pThis->abTxBuf[0], &pThis->abTxBuf[cbProcessed], pThis->cbTxUsed); 258 pThis->cbTxUsed -= cbProcessed; 259 if (pThis->cbTxUsed) 260 { 261 /* Move the data in the TX buffer to the front to fill the end again. */ 262 memmove(&pThis->abTxBuf[0], &pThis->abTxBuf[cbProcessed], pThis->cbTxUsed); 263 } 264 else 265 pThis->pDrvSerialPort->pfnDataSentNotify(pThis->pDrvSerialPort); 266 STAM_COUNTER_ADD(&pThis->StatBytesWritten, cbProcessed); 261 267 } 262 else 263 pThis->pDrvSerialPort->pfnDataSentNotify(pThis->pDrvSerialPort); 264 STAM_COUNTER_ADD(&pThis->StatBytesWritten, cbProcessed); 265 } 266 else if (rc != VERR_TIMEOUT) 267 { 268 LogRel(("Char#%d: Write failed with %Rrc; skipping\n", pDrvIns->iInstance, rc)); 269 break; 268 else if (rc != VERR_TIMEOUT) 269 { 270 LogRel(("Char#%d: Write failed with %Rrc; skipping\n", pDrvIns->iInstance, rc)); 271 break; 272 } 270 273 } 271 274 }
Note:
See TracChangeset
for help on using the changeset viewer.