1435
|
1 Using read with a timeout does a longjmp() out of a signal handler, which leaves
|
|
2 SIGARLM blocked. This is inherited by children, and thus not something you
|
|
3 want to do from PID 1.
|
|
4
|
|
5 diff -ru bash/builtins/read.def bash.bak/builtins/read.def
|
|
6 --- bash/builtins/read.def 2002-03-19 13:33:41.000000000 -0600
|
|
7 +++ bash.bak/builtins/read.def 2011-09-07 23:11:56.853885092 -0500
|
|
8 @@ -101,6 +101,11 @@
|
|
9 sigalrm (s)
|
|
10 int s;
|
|
11 {
|
|
12 + sigset_t walrus;
|
|
13 +
|
|
14 + sigemptyset(&walrus);
|
|
15 + sigaddset(&walrus, SIGALRM);
|
|
16 + sigprocmask(SIG_UNBLOCK, &walrus, 0);
|
|
17 longjmp (alrmbuf, 1);
|
|
18 }
|
|
19
|