Changeset 203 for trunk/src


Ignore:
Timestamp:
Oct 6, 2009, 12:22:41 AM (16 years ago)
Author:
Dmitry A. Kuminov
Message:

corelib: Fixed sending data to standard input with QProcess::write().

Location:
trunk/src/corelib/io
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/corelib/io/qprocess.cpp

    r197 r203  
    636636
    637637    qint64 written = writeToStdin(writeBuffer.readPointer(),
    638                                       writeBuffer.nextDataBlockSize());
     638                                  writeBuffer.nextDataBlockSize());
    639639    if (written < 0) {
    640640        destroyPipe(stdinChannel.pipe);
     
    14401440           data, qt_prettyDebug(data, len, 16).constData(), len);
    14411441#endif
     1442
     1443
     1444
     1445
     1446
    14421447        return 1;
    14431448    }
     
    14501455    qDebug("QProcess::writeData(%p \"%s\", %lld) == %lld (written to buffer)",
    14511456           data, qt_prettyDebug(data, len, 16).constData(), len, len);
     1457
     1458
     1459
     1460
     1461
    14521462#endif
    14531463    return len;
  • trunk/src/corelib/io/qprocess_os2.cpp

    r198 r203  
    10161016}
    10171017
     1018
     1019
     1020
     1021
     1022
     1023
     1024
     1025
     1026
     1027
     1028
     1029
     1030
     1031
     1032
    10181033qint64 QProcessPrivate::readFromStdout(char *data, qint64 maxlen)
    10191034{
     
    10611076    APIRET arc = DosWrite(stdinChannel.pipe.server, data, maxlen, &actual);
    10621077
    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 if
    1068     // 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    ;
     1081        // update our counter
     1082   
     1083   
     1084   
    10701085
    10711086#if defined QPROCESS_DEBUG
  • trunk/src/corelib/io/qprocess_p.h

    r198 r203  
    251251    qint64 bytesAvailableFromStdout() const;
    252252    qint64 bytesAvailableFromStderr() const;
     253
     254
     255
    253256    qint64 readFromStdout(char *data, qint64 maxlen);
    254257    qint64 readFromStderr(char *data, qint64 maxlen);
Note: See TracChangeset for help on using the changeset viewer.