Contents of /trunk/bash/patches/bash-3.0-jobs.patch
Parent Directory | Revision Log
Revision 144 -
(show annotations)
(download)
Tue May 8 20:06:05 2007 UTC (17 years, 4 months ago) by niro
File size: 1064 byte(s)
Tue May 8 20:06:05 2007 UTC (17 years, 4 months ago) by niro
File size: 1064 byte(s)
-import
1 | --- bash-3.0/tests/jobs4.sub.jobs 2004-05-06 14:02:41.000000000 +0100 |
2 | +++ bash-3.0/tests/jobs4.sub 2004-09-08 16:07:25.305385245 +0100 |
3 | @@ -18,5 +18,5 @@ |
4 | |
5 | wait |
6 | |
7 | -cat & |
8 | +sleep 100 & |
9 | kill -1 %% && echo i killed it || echo could not kill it |
10 | --- bash-3.0/jobs.c.jobs 2004-09-08 16:07:25.081427747 +0100 |
11 | +++ bash-3.0/jobs.c 2004-09-08 16:18:06.698604033 +0100 |
12 | @@ -2475,6 +2475,7 @@ |
13 | PROCESS *child; |
14 | pid_t pid; |
15 | int call_set_current, last_stopped_job, job, children_exited, waitpid_flags; |
16 | + static int wcontinued_not_supported = 0; |
17 | |
18 | call_set_current = children_exited = 0; |
19 | last_stopped_job = NO_JOB; |
20 | @@ -2488,7 +2489,15 @@ |
21 | : 0; |
22 | if (sigchld || block == 0) |
23 | waitpid_flags |= WNOHANG; |
24 | + retry: |
25 | + if (wcontinued_not_supported) |
26 | + waitpid_flags &= ~WCONTINUED; |
27 | pid = WAITPID (-1, &status, waitpid_flags); |
28 | + if (pid == -1 && errno == EINVAL) |
29 | + { |
30 | + wcontinued_not_supported = 1; |
31 | + goto retry; |
32 | + } |
33 | |
34 | /* The check for WNOHANG is to make sure we decrement sigchld only |
35 | if it was non-zero before we called waitpid. */ |