Patch from Magnus Damm <damm@opensource.se> to avoid lash hanging
on serial ports
This commit is contained in:
parent
35636540ea
commit
f0a4ac8216
8
lash.c
8
lash.c
@ -1524,9 +1524,15 @@ void free_memory(void)
|
|||||||
* we don't fight over who gets the foreground */
|
* we don't fight over who gets the foreground */
|
||||||
static void setup_job_control()
|
static void setup_job_control()
|
||||||
{
|
{
|
||||||
|
int status;
|
||||||
|
|
||||||
/* Loop until we are in the foreground. */
|
/* Loop until we are in the foreground. */
|
||||||
while (tcgetpgrp (shell_terminal) != (shell_pgrp = getpgrp ()))
|
while ((status = tcgetpgrp (shell_terminal)) >= 0) {
|
||||||
|
if (status == (shell_pgrp = getpgrp ())) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
kill (- shell_pgrp, SIGTTIN);
|
kill (- shell_pgrp, SIGTTIN);
|
||||||
|
}
|
||||||
|
|
||||||
/* Ignore interactive and job-control signals. */
|
/* Ignore interactive and job-control signals. */
|
||||||
signal(SIGINT, SIG_IGN);
|
signal(SIGINT, SIG_IGN);
|
||||||
|
@ -1524,9 +1524,15 @@ void free_memory(void)
|
|||||||
* we don't fight over who gets the foreground */
|
* we don't fight over who gets the foreground */
|
||||||
static void setup_job_control()
|
static void setup_job_control()
|
||||||
{
|
{
|
||||||
|
int status;
|
||||||
|
|
||||||
/* Loop until we are in the foreground. */
|
/* Loop until we are in the foreground. */
|
||||||
while (tcgetpgrp (shell_terminal) != (shell_pgrp = getpgrp ()))
|
while ((status = tcgetpgrp (shell_terminal)) >= 0) {
|
||||||
|
if (status == (shell_pgrp = getpgrp ())) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
kill (- shell_pgrp, SIGTTIN);
|
kill (- shell_pgrp, SIGTTIN);
|
||||||
|
}
|
||||||
|
|
||||||
/* Ignore interactive and job-control signals. */
|
/* Ignore interactive and job-control signals. */
|
||||||
signal(SIGINT, SIG_IGN);
|
signal(SIGINT, SIG_IGN);
|
||||||
|
Loading…
Reference in New Issue
Block a user