Ignore:
Timestamp:
Jul 25, 2011, 2:36:02 PM (14 years ago)
Author:
Dmitry A. Kuminov
Message:

OS/2: QProcess: Don't close the stdin pipe until the child reads it all.

This fixes the cases when the child process receives truncated data sent to its stdin by the parent process with QProcess::write(). This is due to the fact that writing a chunk of data to a pipe and then closing it will make this data unavailable to the other end if it is not fast enough to read it in between.

File:
1 edited

Legend:

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

    r902 r911  
    553553    pipe.server = HPIPE(~0);
    554554    pipe.client = HFILE(~0);
     555
    555556
    556557    // we need the process identifier to guarantee pipe name unicity
     
    612613void QProcessPrivate::destroyPipe(Channel::Pipe &pipe)
    613614{
     615
     616
    614617    if (pipe.client != ~HFILE(~0)) {
    615618        DosClose(pipe.client);
     
    634637    channel.pipe.server = HPIPE(~0);
    635638    channel.pipe.client = HFILE(~0);
     639
    636640
    637641    if (&channel == &stderrChannel && processChannelMode == QProcess::MergedChannels) {
     
    13421346}
    13431347
     1348
     1349
     1350
     1351
     1352
     1353
     1354
     1355
     1356
     1357
     1358
     1359
     1360
     1361
     1362
     1363
     1364
    13441365qint64 QProcessPrivate::writeToStdin(const char *data, qint64 maxlen)
    13451366{
Note: See TracChangeset for help on using the changeset viewer.