fix broken interactive tty on live-exec

This commit is contained in:
zawz 2021-06-29 14:07:24 +02:00
parent 8c3d693182
commit d8b3041e85
2 changed files with 0 additions and 5 deletions

View file

@ -157,8 +157,6 @@ Directly execute an extended lxsh script with either
> Direct execution introduces direct dependency on lxsh and code parsing overhead,
> therefore it should be avoided in production environments.
> stdin is known to not work properly on direct execution as of now
### Variable/Function/command listing
You can list all calls of variables, functions or commands with `--list-*` options

View file

@ -194,15 +194,12 @@ void parse_exec(FILE* fd, parse_context ctx)
pid_t forkexec(const char* bin, char *const args[])
{
pid_t child_pid;
// int tfd = dup(STDIN_FILENO);
// std::cout << tfd << std::endl;
if((child_pid = vfork()) == -1)
{
throw std::runtime_error("fork() failed");
}
if (child_pid == 0) // child process
{
setpgid(child_pid, child_pid); //Needed so negative PIDs can kill children of /bin/sh
execv(bin, args);
throw std::runtime_error("execv() failed");
}