mirror of
https://github.com/BeamMP/BeamMP-Launcher.git
synced 2025-07-01 15:36:10 +00:00
turn off stdout, stderr of the game on linux (#124)
This commit is contained in:
commit
9c59a83f04
@ -100,7 +100,11 @@ void StartGame(std::string Dir) {
|
||||
std::string filename = (Dir + "/BinLinux/BeamNG.x64");
|
||||
char* argv[] = { filename.data(), NULL };
|
||||
pid_t pid;
|
||||
int result = posix_spawn(&pid, filename.c_str(), NULL, NULL, argv, environ);
|
||||
posix_spawn_file_actions_t spawn_actions;
|
||||
posix_spawn_file_actions_init(&spawn_actions);
|
||||
posix_spawn_file_actions_addclose(&spawn_actions, STDOUT_FILENO);
|
||||
posix_spawn_file_actions_addclose(&spawn_actions, STDERR_FILENO);
|
||||
int result = posix_spawn(&pid, filename.c_str(), &spawn_actions, nullptr, argv, environ);
|
||||
|
||||
if (result != 0) {
|
||||
error("Failed to Launch the game! launcher closing soon");
|
||||
|
Loading…
x
Reference in New Issue
Block a user