- Timestamp:
- Oct 6, 2009, 12:22:41 AM (16 years ago)
- Location:
- trunk/src/corelib/io
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/corelib/io/qprocess.cpp
r197 r203 636 636 637 637 qint64 written = writeToStdin(writeBuffer.readPointer(), 638 638 writeBuffer.nextDataBlockSize()); 639 639 if (written < 0) { 640 640 destroyPipe(stdinChannel.pipe); … … 1440 1440 data, qt_prettyDebug(data, len, 16).constData(), len); 1441 1441 #endif 1442 #if defined(Q_OS_OS2) 1443 qint64 available = d->bytesAvailableInStdin(); 1444 if (available > 0) 1445 d->_q_canWrite(); 1446 #endif 1442 1447 return 1; 1443 1448 } … … 1450 1455 qDebug("QProcess::writeData(%p \"%s\", %lld) == %lld (written to buffer)", 1451 1456 data, qt_prettyDebug(data, len, 16).constData(), len, len); 1457 #endif 1458 #if defined(Q_OS_OS2) 1459 qint64 available = d->bytesAvailableInStdin(); 1460 if (available > 0) 1461 d->_q_canWrite(); 1452 1462 #endif 1453 1463 return len; -
trunk/src/corelib/io/qprocess_os2.cpp
r198 r203 1016 1016 } 1017 1017 1018 qint64 QProcessPrivate::bytesAvailableInStdin() const 1019 { 1020 QProcessPrivate* that = const_cast<QProcessPrivate*>(this); 1021 1022 // grab new bytes from QProcessManager (if any) 1023 int newBytes = that->pipeData[InPipe].newBytes.fetchAndStoreRelaxed(0); 1024 that->pipeData[InPipe].bytesLeft += newBytes; 1025 1026 #if defined (QPROCESS_DEBUG) 1027 qDebug("QProcessPrivate::bytesAvailableInStdin() == %lld", 1028 that->pipeData[InPipe].bytesLeft); 1029 #endif 1030 return that->pipeData[InPipe].bytesLeft; 1031 } 1032 1018 1033 qint64 QProcessPrivate::readFromStdout(char *data, qint64 maxlen) 1019 1034 { … … 1061 1076 APIRET arc = DosWrite(stdinChannel.pipe.server, data, maxlen, &actual); 1062 1077 1063 qint64 written = arc == NO_ERROR ? (qint64)actual :-1;1064 1065 QProcessPrivate* that = const_cast<QProcessPrivate*>(this);1066 1067 // reset the counter so that QProcessManager will inform us again if1068 // more space is available (note that we don't care about the actual number)1069 that->pipeData[InPipe].newBytes.fetchAndStoreRelaxed(0);1078 qint64 written = -1; 1079 if (arc == NO_ERROR) { 1080 written = (qint64)actual; 1081 // update our counter 1082 Q_ASSERT(pipeData[InPipe].bytesLeft >= written); 1083 pipeData[InPipe].bytesLeft -= written; 1084 } 1070 1085 1071 1086 #if defined QPROCESS_DEBUG -
trunk/src/corelib/io/qprocess_p.h
r198 r203 251 251 qint64 bytesAvailableFromStdout() const; 252 252 qint64 bytesAvailableFromStderr() const; 253 #if defined(Q_OS_OS2) 254 qint64 bytesAvailableInStdin() const; 255 #endif 253 256 qint64 readFromStdout(char *data, qint64 maxlen); 254 257 qint64 readFromStderr(char *data, qint64 maxlen);
Note:
See TracChangeset
for help on using the changeset viewer.