source:
patches/bash-3.0-avoid_WCONTINUED_if_invalid.patch@
3d0b9df
Last change on this file since 3d0b9df was 617118d, checked in by , 19 years ago | |
---|---|
|
|
File size: 1.1 KB |
-
bash-3.0/jobs.c
Reported on bug-bash by Tim Waugh <twaugh@redhat.com> http://lists.gnu.org/archive/html/bug-bash/2004-09/msg00081.html GNU libc defines WCONTINUED, but (at least on Linux 2.4.x kernels) waitpid() returns -1 with errno set to EINVAL if WCONTINUED is supplied in options. Here is a patch to retry without WCONTINUED set in that case.
old new (this hunk was shorter than expected) … … 2471 2471 PROCESS *child; 2472 2472 pid_t pid; 2473 2473 int call_set_current, last_stopped_job, job, children_exited, waitpid_flags; 2474 static int wcontinued_not_supported = 0; 2474 2475 2475 2476 call_set_current = children_exited = 0; 2476 2477 last_stopped_job = NO_JOB; … … 2484 2485 : 0; 2485 2486 if (sigchld || block == 0) 2486 2487 waitpid_flags |= WNOHANG; 2488 retry: 2489 if (wcontinued_not_supported) 2490 waitpid_flags &= ~WCONTINUED; 2487 2491 pid = WAITPID (-1, &status, waitpid_flags); 2492 if (errno == EINVAL) 2493 { 2494 wcontinued_not_supported = 1; 2495 goto retry; 2496 } 2488 2497 2489 2498 /* The check for WNOHANG is to make sure we decrement sigchld only 2490 2499 if it was non-zero before we called waitpid. */
Note:
See TracBrowser
for help on using the repository browser.