Skip to content
Snippets Groups Projects
Commit a5616f03 authored by Tristan Walter's avatar Tristan Walter
Browse files

windows

parent 7440aebe
No related branches found
No related tags found
No related merge requests found
...@@ -542,11 +542,23 @@ int main(int argc, char** argv) ...@@ -542,11 +542,23 @@ int main(int argc, char** argv)
#endif #endif
auto exec = wd.str() + " " + opening_result.cmd; auto exec = wd.str() + " " + opening_result.cmd;
Debug("Executing '%S'", &exec); Debug("Executing '%S'", &exec);
#if defined(WIN32)
STARTUPINFO info={sizeof(info)};
PROCESS_INFORMATION processInfo;
if (CreateProcess(wd.c_str(), opening_result.cmd.c_str(), NULL, NULL, TRUE, 0, NULL, NULL, &info, &processInfo))
{
WaitForSingleObject(processInfo.hProcess, INFINITE);
CloseHandle(processInfo.hProcess);
CloseHandle(processInfo.hThread);
}
#else
auto pid = fork(); auto pid = fork();
if(pid == 0) { if(pid == 0) {
file::exec(exec.c_str()); file::exec(exec.c_str());
exit(0); exit(0);
} }
#endif
return 0; return 0;
} }
} else } else
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment