mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-09 05:30:21 +02:00
When checking whether readline clears SA_RESTART, let readline read
from "/dev/null". Otherwise, it might be stopped when run in the background with job control, say. Thanks to Michael Talbot-Wilson!
This commit is contained in:
parent
4435705715
commit
3894870bde
1 changed files with 10 additions and 0 deletions
|
@ -88,6 +88,16 @@ main ()
|
||||||
action.sa_flags |= SA_RESTART;
|
action.sa_flags |= SA_RESTART;
|
||||||
sigaction (SIGWINCH, &action, NULL);
|
sigaction (SIGWINCH, &action, NULL);
|
||||||
|
|
||||||
|
/* Give readline something to read. Otherwise, it might hang, for
|
||||||
|
example when run as a background process with job control.
|
||||||
|
*/
|
||||||
|
rl_instream = fopen ("/dev/null", "r");
|
||||||
|
if (rl_instream == NULL)
|
||||||
|
{
|
||||||
|
perror ("/dev/null");
|
||||||
|
exit (1);
|
||||||
|
}
|
||||||
|
|
||||||
rl_pre_input_hook = hook;
|
rl_pre_input_hook = hook;
|
||||||
readline ("");
|
readline ("");
|
||||||
}],
|
}],
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue