- Timestamp:
- Feb 24, 2010, 10:26:07 PM (15 years ago)
- Location:
- trunk/src/corelib/io
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/corelib/io/qprocess.cpp
r561 r600 2132 2132 The started process will run as a regular standalone process. 2133 2133 2134 \bold{OS/2:} The started process will run in its own session which is 2135 completely independent from the session of the starting application and 2136 will continue execution after the starting application terminates. 2137 2134 2138 The process will be started in the directory \a workingDirectory. 2135 2139 2136 2140 If the function is successful then *\a pid is set to the process 2137 2141 identifier of the started process. 2142 2143 Note that on OS/2, the PID of the started process is unknown and the value 2144 returned in \a pid is always 0. 2138 2145 */ 2139 2146 bool QProcess::startDetached(const QString &program, -
trunk/src/corelib/io/qprocess_os2.cpp
r583 r600 53 53 #include <qthread.h> 54 54 55 #if defined(__INNOTEK_LIBC__) 56 #include <emx/umalloc.h> // for _lmalloc() 57 #endif 58 55 59 /* 56 60 Returns a human readable representation of the first \a len … … 941 945 // @todo use P_SESSION once it's implemented in kLIBC! 942 946 // @todo check if FS VIO apps need a proxy 943 programReal = getenv("COMSPEC"); // returns static!947 programReal = ::getenv("COMSPEC"); // returns static! 944 948 if (programReal == 0) 945 949 programReal = "cmd.exe"; … … 984 988 args.prepend(programReal); 985 989 args.prepend("/C \""); 986 programReal = getenv("COMSPEC"); // returns static!990 programReal = ::getenv("COMSPEC"); // returns static! 987 991 if (programReal == 0) 988 992 programReal = "cmd.exe"; … … 993 997 for (char **e = envv; *e; ++e) 994 998 env += *e + '\0'; 999 1000 #if defined(__INNOTEK_LIBC__) 1001 // make sure we store arguments in the low memory for 1002 // DosStartSession() as it cannot work with high memory 1003 PSZ pgmNameLow = (PSZ)::_lmalloc(::strlen(programReal) + 1); 1004 ::strcpy(pgmNameLow, programReal); 1005 PSZ argsLow = (PSZ)::_lmalloc(args.size()); 1006 ::memcpy(argsLow, args, args.size()); 1007 PSZ envLow = 0; 1008 if (!env.isEmpty()) { 1009 envLow = (PSZ)::_lmalloc(env.size()); 1010 ::memcpy(envLow, env, env.size()); 1011 } 1012 #else 1013 PSZ pgmNameLow = (PSZ)programReal; 1014 PSZ argsLow = args.data(); 1015 PSZ envLow = env.isEmpty() ? 0 : env.data(); 1016 #endif 995 1017 996 1018 STARTDATA data; … … 1000 1022 data.TraceOpt = SSF_TRACEOPT_NONE; 1001 1023 data.PgmTitle = 0; 1002 data.PgmName = (PSZ)programReal;1003 data.PgmInputs = args .data();1024 data.PgmName = pgmNameLow; 1025 data.PgmInputs = argsLow; 1004 1026 data.TermQ = 0; 1005 data.Environment = env .isEmpty() ? 0 : env.data();1027 data.Environment = envLow; 1006 1028 data.InheritOpt = SSF_INHERTOPT_PARENT; 1007 1029 data.SessionType = SSF_TYPE_DEFAULT; … … 1014 1036 data.ObjectBuffLen = 0; 1015 1037 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 1019 1056 } else { 1020 1057 pid = spawnve(mode, programReal, const_cast<char * const *>(argvReal), envv);
Note:
See TracChangeset
for help on using the changeset viewer.