Changeset 609


Ignore:
Timestamp:
Feb 26, 2010, 7:44:40 PM (15 years ago)
Author:
Dmitry A. Kuminov
Message:

corelib: Fixed QProcess: Data could not be successfully read or written to the standard streams of the started process in 'highmem' link mode (which is on by default since 4.5.1 GA).

File:
1 edited

Legend:

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

    r601 r609  
    190190        return;
    191191
    192     // set deathEvent to 1 and post the semaphore if not already done so
     192    // set death to 1 and post the semaphore if not already done so
    193193    if (instance->deathFlag.testAndSetRelaxed(0, 1)) {
    194194        APIRET rc = DosPostEventSem(instance->eventSem);
     
    366366void QProcessManager::installSigHandler()
    367367{
    368     // set up the SIGCHLD handler which calls posts a semaphore wenever
     368    // set up the SIGCHLD handler which enever
    369369    // our child dies
    370370    struct sigaction oldAction;
     
    407407
    408408    // an array for 1 process is initially enough
    409     QVector<PIPESEMSTATE> pipeStates(3 * 2 + 1);
     409    int pipeStatesSize = sizeof(PIPESEMSTATE) * (3 * 2 + 1);
     410    PPIPESEMSTATE pipeStates = (PPIPESEMSTATE)::_lmalloc(pipeStatesSize);
    410411
    411412    do {
     
    448449        // is sz * 2 (to be able to store both NPSS_RDATA/NPSS_WSPACE and
    449450        // NPSS_CLOSE for every pipe) + one for NPSS_EOI
    450         int bestSize = processes.size() * 3 * 2 + 1;
    451         if (pipeStates.size() < bestSize)
    452             pipeStates.resize(bestSize);
    453 
    454         arc = DosQueryNPipeSemState((HSEM)eventSem, pipeStates.data(),
    455                                     pipeStates.size() * sizeof(PIPESEMSTATE));
     451        int bestSize = sizeof(PIPESEMSTATE) * (processes.size() * 3 * 2 + 1);
     452        if (pipeStatesSize < bestSize) {
     453            pipeStates = (PPIPESEMSTATE)_lrealloc(pipeStates, bestSize);
     454            pipeStatesSize = bestSize;
     455        }
     456
     457        arc = DosQueryNPipeSemState((HSEM)eventSem, pipeStates, pipeStatesSize);
    456458        if (arc != NO_ERROR) {
    457459            qWarning("QProcessManager::run: DosQueryNPipeSemState returned %lu", arc);
     
    533535        }
    534536    } while (true);
     537
     538
    535539
    536540#if defined (QPROCESS_DEBUG)
Note: See TracChangeset for help on using the changeset viewer.