[617118d] | 1 | Submitted By: Jeremy Utley <jeremy@linuxfromscratch.org>
|
---|
| 2 | Date: 2004-10-13
|
---|
| 3 | Initial Package Version: 3.0
|
---|
| 4 | Upstream Status: Submitted Upstream
|
---|
| 5 | Origin: Originally created by Greg Schafer
|
---|
| 6 | Description: Bash-3.0 has a execution problem with newer Glibc's. This patch,
|
---|
| 7 | submitted to bash-bugs by Tim Waugh, fixes the problem. See:
|
---|
| 8 | http://lists.gnu.org/archive/html/bug-bash/2004-09/msg00081.html
|
---|
| 9 | Patch also contains a slight code change taken from Fedora SRPM.
|
---|
| 10 |
|
---|
| 11 |
|
---|
| 12 | diff -Naur bash-3.0.orig/jobs.c bash-3.0/jobs.c
|
---|
| 13 | --- bash-3.0.orig/jobs.c 2004-10-12 08:50:11.643481280 +0000
|
---|
| 14 | +++ bash-3.0/jobs.c 2004-10-12 08:51:35.110792320 +0000
|
---|
| 15 | @@ -2476,6 +2476,7 @@
|
---|
| 16 | PROCESS *child;
|
---|
| 17 | pid_t pid;
|
---|
| 18 | int call_set_current, last_stopped_job, job, children_exited, waitpid_flags;
|
---|
| 19 | + static int wcontinued_not_supported = 0;
|
---|
| 20 |
|
---|
| 21 | call_set_current = children_exited = 0;
|
---|
| 22 | last_stopped_job = NO_JOB;
|
---|
| 23 | @@ -2489,7 +2490,15 @@
|
---|
| 24 | : 0;
|
---|
| 25 | if (sigchld || block == 0)
|
---|
| 26 | waitpid_flags |= WNOHANG;
|
---|
| 27 | + retry:
|
---|
| 28 | + if (wcontinued_not_supported)
|
---|
| 29 | + waitpid_flags &= ~WCONTINUED;
|
---|
| 30 | pid = WAITPID (-1, &status, waitpid_flags);
|
---|
| 31 | + if (pid == -1 && errno == EINVAL)
|
---|
| 32 | + {
|
---|
| 33 | + wcontinued_not_supported = 1;
|
---|
| 34 | + goto retry;
|
---|
| 35 | + }
|
---|
| 36 |
|
---|
| 37 | /* The check for WNOHANG is to make sure we decrement sigchld only
|
---|
| 38 | if it was non-zero before we called waitpid. */
|
---|