Initialize master terminal of processes run inside a pseudo-terminal before forking.

[INTEPRETER]
* NEW: Initialize master terminal of processes run inside a pseudo-terminal before forking.
This commit is contained in:
gambas 2017-08-26 13:11:59 +02:00
parent c7d4a97125
commit 359471cc30

View file

@ -603,6 +603,18 @@ static void run_process(CPROCESS *process, int mode, void *cmd, CARRAY *env)
#ifdef DEBUG_ME
fprintf(stderr, "run_process: slave = %s\n", slave);
#endif
if (mode & PM_TERM)
{
if (tcgetattr(fd_master, &termios_master))
goto __ABORT_ERRNO;
cfmakeraw(&termios_master);
//termios_master.c_lflag &= ~ECHO;
if (tcsetattr(fd_master, TCSANOW, &termios_master))
goto __ABORT_ERRNO;
}
}
else
{
@ -653,18 +665,6 @@ static void run_process(CPROCESS *process, int mode, void *cmd, CARRAY *env)
fprintf(stderr, "fork: pid = %d\n", pid);
#endif
if (mode & PM_TERM)
{
if (tcgetattr(fd_master, &termios_master))
goto __ABORT_ERRNO;
cfmakeraw(&termios_master);
//termios_master.c_lflag &= ~ECHO;
if (tcsetattr(fd_master, TCSANOW, &termios_master))
goto __ABORT_ERRNO;
}
if (mode & PM_WRITE)
{
if (mode & PM_TERM)