- Timestamp:
- Mar 7, 2010, 9:17:02 PM (15 years ago)
- Location:
- trunk/src/corelib/io
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/corelib/io/qprocess.cpp
r600 r646 1816 1816 #endif 1817 1817 #if defined(Q_OS_OS2) 1818 qint64 available = d->bytesAvailableInStdin(); 1819 if (available > 0) 1820 d->_q_canWrite(); 1818 // try to write some bytes (there may be space in the pipe) 1819 d->_q_canWrite(); 1821 1820 #endif 1822 1821 return 1; … … 1832 1831 #endif 1833 1832 #if defined(Q_OS_OS2) 1834 qint64 available = d->bytesAvailableInStdin(); 1835 if (available > 0) 1836 d->_q_canWrite(); 1833 // try to write some bytes (there may be space in the pipe) 1834 d->_q_canWrite(); 1837 1835 #endif 1838 1836 return len; -
trunk/src/corelib/io/qprocess_os2.cpp
r645 r646 1314 1314 } 1315 1315 1316 that->pipeData[OutPipe].bytesLeft += newBytes; 1316 if (newBytes) 1317 that->pipeData[OutPipe].bytesLeft = newBytes; 1317 1318 1318 1319 #if defined (QPROCESS_DEBUG) … … 1348 1349 } 1349 1350 1350 that->pipeData[ErrPipe].bytesLeft += newBytes; 1351 if (newBytes) 1352 that->pipeData[ErrPipe].bytesLeft = newBytes; 1351 1353 1352 1354 #if defined (QPROCESS_DEBUG) … … 1355 1357 #endif 1356 1358 return that->pipeData[ErrPipe].bytesLeft; 1357 }1358 1359 qint64 QProcessPrivate::bytesAvailableInStdin() const1360 {1361 QProcessPrivate* that = const_cast<QProcessPrivate*>(this);1362 1363 // grab new bytes from QProcessManager (if any)1364 int newBytes = that->pipeData[InPipe].newBytes.fetchAndStoreRelaxed(0);1365 that->pipeData[InPipe].bytesLeft += newBytes;1366 1367 #if defined (QPROCESS_DEBUG)1368 qDebug("QProcessPrivate::bytesAvailableInStdin() == %lld",1369 that->pipeData[InPipe].bytesLeft);1370 #endif1371 return that->pipeData[InPipe].bytesLeft;1372 1359 } 1373 1360 … … 1414 1401 qint64 QProcessPrivate::writeToStdin(const char *data, qint64 maxlen) 1415 1402 { 1403 QProcessPrivate* that = const_cast<QProcessPrivate*>(this); 1404 1405 // grab new bytes from QProcessManager (if any) 1406 int newBytes = that->pipeData[InPipe].newBytes.fetchAndStoreRelaxed(0); 1407 if (newBytes) 1408 that->pipeData[InPipe].bytesLeft = newBytes; 1409 1410 #if defined (QPROCESS_DEBUG) 1411 qDebug("QProcessPrivate::writeToStdin(): %lld free bytes in pipe", 1412 that->pipeData[InPipe].bytesLeft); 1413 #endif 1414 if (!that->pipeData[InPipe].bytesLeft) 1415 return 0; 1416 1416 1417 ULONG actual = 0; 1417 1418 APIRET arc = DosWrite(stdinChannel.pipe.server, data, maxlen, &actual); -
trunk/src/corelib/io/qprocess_p.h
r561 r646 271 271 qint64 bytesAvailableFromStdout() const; 272 272 qint64 bytesAvailableFromStderr() const; 273 #if defined(Q_OS_OS2) 274 qint64 bytesAvailableInStdin() const; 275 #endif 273 276 274 qint64 readFromStdout(char *data, qint64 maxlen); 277 275 qint64 readFromStderr(char *data, qint64 maxlen);
Note:
See TracChangeset
for help on using the changeset viewer.