Changeset 609
- Timestamp:
- Feb 26, 2010, 7:44:40 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/corelib/io/qprocess_os2.cpp
r601 r609 190 190 return; 191 191 192 // set death Eventto 1 and post the semaphore if not already done so192 // set death to 1 and post the semaphore if not already done so 193 193 if (instance->deathFlag.testAndSetRelaxed(0, 1)) { 194 194 APIRET rc = DosPostEventSem(instance->eventSem); … … 366 366 void QProcessManager::installSigHandler() 367 367 { 368 // set up the SIGCHLD handler which calls posts a semaphore wenever368 // set up the SIGCHLD handler which enever 369 369 // our child dies 370 370 struct sigaction oldAction; … … 407 407 408 408 // 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); 410 411 411 412 do { … … 448 449 // is sz * 2 (to be able to store both NPSS_RDATA/NPSS_WSPACE and 449 450 // 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); 456 458 if (arc != NO_ERROR) { 457 459 qWarning("QProcessManager::run: DosQueryNPipeSemState returned %lu", arc); … … 533 535 } 534 536 } while (true); 537 538 535 539 536 540 #if defined (QPROCESS_DEBUG)
Note:
See TracChangeset
for help on using the changeset viewer.