git-svn-id: svn://db.shs.com.ru/pip@446 12ceb7fc-bf1f-11e4-8940-5bc7170c53b5

This commit is contained in:
2017-04-20 12:16:33 +00:00
parent 6b9b16dbe8
commit 690bec7231
2 changed files with 10 additions and 6 deletions

View File

@@ -172,7 +172,7 @@ void PIProcess::startProc(bool detached) {
#else #else
//cout << "exec " << tf_in << ", " << tf_out << ", " << tf_err << endl; //cout << "exec " << tf_in << ", " << tf_out << ", " << tf_err << endl;
PIStringList clsl; /*PIStringList clsl;
char * a_ = e[0]; char * a_ = e[0];
int ai_ = 0; int ai_ = 0;
while (a_) { while (a_) {
@@ -181,7 +181,7 @@ void PIProcess::startProc(bool detached) {
ai_++; ai_++;
a_ = e[ai_]; a_ = e[ai_];
} }
piCoutObj << clsl; piCoutObj << clsl;*/
if (execve(str.data(), a, e) < 0) if (execve(str.data(), a, e) < 0)
piCoutObj << "\"execve" << str << args << "\" error :" << errorString(); piCoutObj << "\"execve" << str << args << "\" error :" << errorString();
} else { } else {

View File

@@ -337,10 +337,14 @@ int main(int argc, char * argv[]) {
args << "-n" << name; args << "-n" << name;
//PIProcess p; //PIProcess p;
//p.exec("/bin/readlink", PIStringList() << "/proc/self/exe"); //p.exec("/bin/readlink", PIStringList() << "/proc/self/exe");
piCout << PIProcess::getEnvironmentVariable("_"); PIString exe;
piCout << PIProcess::currentEnvironment(); #ifdef WINDOWS
piCout << "start in background:" << PISystemInfo::instance()->execCommand;// << "; with args" << args; exe = PISystemInfo::instance()->execCommand;
//PIProcess::execIndependent(PISystemInfo::instance()->execCommand, args); #else
exe = PIProcess::getEnvironmentVariable("_");
#endif
piCout << "start in background:" << exe;// << "; with args" << args;
PIProcess::execIndependent(exe, args);
return 0; return 0;
} }
PIINTROSPECTION_START PIINTROSPECTION_START