Changeset 699
- Timestamp:
- Mar 18, 2010, 3:42:18 PM (16 years ago)
- File:
-
- 1 edited
-
trunk/src/corelib/io/qprocess_os2.cpp (modified) (36 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/corelib/io/qprocess_os2.cpp
r690 r699 43 43 44 44 //#define QPROCESS_DEBUG 45 #include "qdebug.h"46 45 47 46 #if defined(__INNOTEK_LIBC__) … … 52 51 53 52 #if defined QPROCESS_DEBUG 53 54 54 #include "qstring.h" 55 55 #include <ctype.h> … … 86 86 return out; 87 87 } 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 88 103 QT_END_NAMESPACE 104 105 106 107 89 108 #endif 90 109 … … 246 265 USHORT QProcessManager::addProcess(QProcess *process) 247 266 { 248 #if defined (QPROCESS_DEBUG) 249 qDebug("QProcessManager::addProcess(%p)", process); 250 #endif 267 DEBUG(("QProcessManager::addProcess(%p)", process)); 251 268 252 269 QMutexLocker locker(&mutex); … … 317 334 QProcess *process = instance->processes[procKey]; 318 335 319 #if defined (QPROCESS_DEBUG) 320 qDebug("QProcessManager::removeProcess(%p)", process); 321 #endif 336 DEBUG(("QProcessManager::removeProcess(%p)", process)); 322 337 323 338 // to guarantee that the given procKey may be reused, we must close all … … 339 354 : refcnt(0), finish(false), eventSem(NULLHANDLE), sa_old_sigchld_handler(0) 340 355 { 341 #if defined (QPROCESS_DEBUG) 342 qDebug() << "QProcessManager::QProcessManager()"; 343 #endif 356 DEBUG(() << "QProcessManager::QProcessManager()"); 344 357 345 358 APIRET rc = DosCreateEventSem(NULL, &eventSem, … … 354 367 QProcessManager::~QProcessManager() 355 368 { 356 #if defined (QPROCESS_DEBUG) 357 qDebug() << "QProcessManager::~QProcessManager()"; 358 #endif 369 DEBUG(() << "QProcessManager::~QProcessManager()"); 359 370 360 371 Q_ASSERT(!refcnt); … … 393 404 void QProcessManager::run() 394 405 { 395 #if defined (QPROCESS_DEBUG) 396 qDebug() << "QProcessManager::run() BEGIN"; 397 #endif 406 DEBUG(() << "QProcessManager::run() BEGIN"); 398 407 399 408 // Note: the rationale behind using a worker thread so far is that … … 419 428 420 429 if (instance->deathFlag.testAndSetRelaxed(1, 0)) { 421 #if defined (QPROCESS_DEBUG) 422 qDebug() << "QProcessManager::run(): child death signaled"; 423 #endif 430 DEBUG(() << "QProcessManager::run(): child death signaled"); 424 431 foreach (QProcess *proc, processes) { 425 432 QProcessPrivate::WaitMode mode = (QProcessPrivate::WaitMode) … … 442 449 continue; 443 450 444 #if defined (QPROCESS_DEBUG) 445 qDebug() << "QProcessManager::run(): checking pipes"; 446 #endif 451 DEBUG(() << "QProcessManager::run(): checking pipes"); 447 452 448 453 // make sure the state array is big enough. The best size for sz pipes … … 477 482 if (pass == 1 && status != NPSS_CLOSE) 478 483 continue; 479 #if defined(QPROCESS_DEBUG) 480 qDebug(" %d/%d: fStatus %u fFlag f%02X usKey %04hX usAvail %hu", 484 DEBUG((" %d/%d: fStatus %u fFlag f%02X usKey %04hX usAvail %hu", 481 485 pass, i, (uint) pipeStates[i].fStatus, 482 486 (uint) pipeStates[i].fFlag, pipeStates[i].usKey, 483 pipeStates[i].usAvail); 484 #endif 487 pipeStates[i].usAvail)); 485 488 int procKey = toProcKey(pipeStates[i].usKey); 486 489 QProcessPrivate::PipeType type = toPipeType(pipeStates[i].usKey); … … 488 491 QProcess *proc = processes[procKey]; 489 492 Q_ASSERT(proc); 490 #if defined(QPROCESS_DEBUG) 491 qDebug(" process %p", proc); 492 #endif 493 DEBUG((" process %p", proc)); 493 494 QProcessPrivate *d = proc->d_func(); 494 495 … … 538 539 ::free(pipeStates); 539 540 540 #if defined (QPROCESS_DEBUG) 541 qDebug() << "QProcessManager::run() END"; 542 #endif 541 DEBUG(() << "QProcessManager::run() END"); 543 542 } 544 543 … … 830 829 } 831 830 832 #if defined(QPROCESS_DEBUG) 833 qDebug("qt_startProcess: workdir is \"%s\"", qPrintable(QDir::currentPath())); 834 #endif 831 DEBUG(("qt_startProcess: workdir is \"%s\"", qPrintable(QDir::currentPath()))); 835 832 836 833 // try to find the executable … … 883 880 } 884 881 885 #if defined(QPROCESS_DEBUG) 886 qDebug("qt_startProcess: found \"%s\" for \"%s\"", 882 DEBUG(("qt_startProcess: found \"%s\" for \"%s\"", 887 883 qPrintable(QFile::decodeName(fullProgramName)), 888 qPrintable(QFile::decodeName(programName))); 889 #endif 884 qPrintable(QFile::decodeName(programName)))); 890 885 891 886 int pid = -1; … … 910 905 paths = path.split(QLatin1Char(';'), QString::SkipEmptyParts); 911 906 if (paths.contains(fullPath, Qt::CaseInsensitive)) { 912 #if defined(QPROCESS_DEBUG) 913 qDebug("qt_startProcess: \"%s\" is already in BEGINLIBPATH", 914 qPrintable(fullPath)); 915 #endif 907 DEBUG(("qt_startProcess: \"%s\" is already in BEGINLIBPATH", 908 qPrintable(fullPath))); 916 909 } else { 917 #if defined(QPROCESS_DEBUG) 918 qDebug("qt_startProcess: prepending \"%s\" to BEGINLIBPATH", 919 qPrintable(fullPath)); 920 #endif 910 DEBUG(("qt_startProcess: prepending \"%s\" to BEGINLIBPATH", 911 qPrintable(fullPath))); 921 912 prependedLibPath = true; 922 913 QByteArray newLibPath = libPathBuf;
