Changeset 600 for trunk/src/corelib


Ignore:
Timestamp:
Feb 24, 2010, 10:26:07 PM (15 years ago)
Author:
Dmitry A. Kuminov
Message:

corelib: Fixed QProcess::startDetached() which would not work in 'highmem' mode (which is on by default). Closes #130.

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

Legend:

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

    r561 r600  
    21322132    The started process will run as a regular standalone process.
    21332133
     2134
     2135
     2136
     2137
    21342138    The process will be started in the directory \a workingDirectory.
    21352139
    21362140    If the function is successful then *\a pid is set to the process
    21372141    identifier of the started process.
     2142
     2143
     2144
    21382145*/
    21392146bool QProcess::startDetached(const QString &program,
  • trunk/src/corelib/io/qprocess_os2.cpp

    r583 r600  
    5353#include <qthread.h>
    5454
     55
     56
     57
     58
    5559/*
    5660    Returns a human readable representation of the first \a len
     
    941945                    // @todo use P_SESSION once it's implemented in kLIBC!
    942946                    // @todo check if FS VIO apps need a proxy
    943                     programReal = getenv("COMSPEC"); // returns static!
     947                    programReal = getenv("COMSPEC"); // returns static!
    944948                    if (programReal == 0)
    945949                        programReal = "cmd.exe";
     
    984988                args.prepend(programReal);
    985989                args.prepend("/C \"");
    986                 programReal = getenv("COMSPEC"); // returns static!
     990                programReal = getenv("COMSPEC"); // returns static!
    987991                if (programReal == 0)
    988992                    programReal = "cmd.exe";
     
    993997                for (char **e = envv; *e; ++e)
    994998                    env += *e + '\0';
     999
     1000
     1001
     1002
     1003
     1004
     1005
     1006
     1007
     1008
     1009
     1010
     1011
     1012
     1013
     1014
     1015
     1016
    9951017
    9961018            STARTDATA data;
     
    10001022            data.TraceOpt = SSF_TRACEOPT_NONE;
    10011023            data.PgmTitle = 0;
    1002             data.PgmName = (PSZ)programReal;
    1003             data.PgmInputs = args.data();
     1024            data.PgmName = ;
     1025            data.PgmInputs = args;
    10041026            data.TermQ = 0;
    1005             data.Environment = env.isEmpty() ? 0 : env.data();
     1027            data.Environment = env;
    10061028            data.InheritOpt = SSF_INHERTOPT_PARENT;
    10071029            data.SessionType = SSF_TYPE_DEFAULT;
     
    10141036            data.ObjectBuffLen = 0;
    10151037
    1016             ULONG ulSid, ulPid;
    1017             if (DosStartSession(&data, &ulSid, &ulPid) == NO_ERROR)
    1018                 pid = ulPid;
     1038            ULONG ulSid, ulPidDummy;
     1039            arc = DosStartSession(&data, &ulSid, &ulPidDummy);
     1040#if defined(QPROCESS_DEBUG)
     1041            qDebug("qt_startProcess: DosStartSession() returned %ld", arc);
     1042#endif
     1043            // Note: for SSF_RELATED_INDEPENDENT, PID of the started process is
     1044            // unknown, return 0 to indicate this
     1045            if (arc == NO_ERROR)
     1046                pid = 0;
     1047            else
     1048                pid = -1;
     1049
     1050#if defined(__INNOTEK_LIBC__)
     1051            if (envLow)
     1052                ::free(envLow);
     1053            ::free(argsLow);
     1054            ::free(pgmNameLow);
     1055#endif
    10191056        } else {
    10201057            pid = spawnve(mode, programReal, const_cast<char * const *>(argvReal), envv);
Note: See TracChangeset for help on using the changeset viewer.