Skip to content

Commit

Permalink
Fix clients unable to exit after testing a node on Linux
Browse files Browse the repository at this point in the history
  • Loading branch information
tindy2013 committed Aug 25, 2020
1 parent c05b565 commit 760b473
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
1 change: 0 additions & 1 deletion src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1031,7 +1031,6 @@ int main(int argc, char* argv[])
//along with some console window info
SetConsoleOutputCP(65001);
#else
signal(SIGUSR1, SIG_IGN);
signal(SIGCHLD, SIG_IGN);
signal(SIGPIPE, SIG_IGN);
signal(SIGABRT, SIG_IGN);
Expand Down
4 changes: 2 additions & 2 deletions src/processes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -132,11 +132,11 @@ bool runProgram(std::string command, std::string runpath, bool wait)
return false;
case 0: /// child
{
signal(SIGINT, SIG_DFL);
setpgid(0, 0);
char curdir[1024] = {};
getcwd(curdir, 1023);
chdir(runpath.data());
execl("/bin/sh", "sh", "-c", command.data(), NULL);
execlp("sh", "sh", "-c", command.data(), (char*)NULL);
_exit(127);
}
default: /// parent
Expand Down

0 comments on commit 760b473

Please sign in to comment.