blob: 6d68059535f2c39b68e24f58f461e0a381517397 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
diff -Nru bash-2.05b.old/jobs.c bash-2.05b/jobs.c
--- bash-2.05b.old/jobs.c 2004-09-28 04:24:20.656378576 -0400
+++ bash-2.05b/jobs.c 2004-09-28 04:24:30.586868912 -0400
@@ -2423,6 +2423,7 @@
PROCESS *child;
pid_t pid;
int call_set_current, last_stopped_job, job, children_exited, waitpid_flags;
+ static int wcontinued_not_supported = 0;
call_set_current = children_exited = 0;
last_stopped_job = NO_JOB;
@@ -2436,7 +2437,15 @@
: 0;
if (sigchld || block == 0)
waitpid_flags |= WNOHANG;
+ retry:
+ if (wcontinued_not_supported)
+ waitpid_flags &= ~WCONTINUED;
pid = WAITPID (-1, &status, waitpid_flags);
+ if (pid == -1 && errno == EINVAL)
+ {
+ wcontinued_not_supported = 1;
+ goto retry;
+ }
/* The check for WNOHANG is to make sure we decrement sigchld only
if it was non-zero before we called waitpid. */
|