fix broken interactive tty on live-exec
This commit is contained in:
parent
8c3d693182
commit
d8b3041e85
2 changed files with 0 additions and 5 deletions
|
|
@ -157,8 +157,6 @@ Directly execute an extended lxsh script with either
|
||||||
> Direct execution introduces direct dependency on lxsh and code parsing overhead,
|
> Direct execution introduces direct dependency on lxsh and code parsing overhead,
|
||||||
> therefore it should be avoided in production environments.
|
> 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
|
### Variable/Function/command listing
|
||||||
|
|
||||||
You can list all calls of variables, functions or commands with `--list-*` options
|
You can list all calls of variables, functions or commands with `--list-*` options
|
||||||
|
|
|
||||||
|
|
@ -194,15 +194,12 @@ void parse_exec(FILE* fd, parse_context ctx)
|
||||||
pid_t forkexec(const char* bin, char *const args[])
|
pid_t forkexec(const char* bin, char *const args[])
|
||||||
{
|
{
|
||||||
pid_t child_pid;
|
pid_t child_pid;
|
||||||
// int tfd = dup(STDIN_FILENO);
|
|
||||||
// std::cout << tfd << std::endl;
|
|
||||||
if((child_pid = vfork()) == -1)
|
if((child_pid = vfork()) == -1)
|
||||||
{
|
{
|
||||||
throw std::runtime_error("fork() failed");
|
throw std::runtime_error("fork() failed");
|
||||||
}
|
}
|
||||||
if (child_pid == 0) // child process
|
if (child_pid == 0) // child process
|
||||||
{
|
{
|
||||||
setpgid(child_pid, child_pid); //Needed so negative PIDs can kill children of /bin/sh
|
|
||||||
execv(bin, args);
|
execv(bin, args);
|
||||||
throw std::runtime_error("execv() failed");
|
throw std::runtime_error("execv() failed");
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue