Merge pull request #4962 from diizzyy/patch-96
[feed/packages.git] / utils / bash / patches / 104-upstream-bash44-004.patch
1 Index: bash-4.4/jobs.c
2 ===================================================================
3 --- bash-4.4.orig/jobs.c
4 +++ bash-4.4/jobs.c
5 @@ -453,6 +453,21 @@ cleanup_the_pipeline ()
6 discard_pipeline (disposer);
7 }
8
9 +void
10 +discard_last_procsub_child ()
11 +{
12 + PROCESS *disposer;
13 + sigset_t set, oset;
14 +
15 + BLOCK_CHILD (set, oset);
16 + disposer = last_procsub_child;
17 + last_procsub_child = (PROCESS *)NULL;
18 + UNBLOCK_CHILD (oset);
19 +
20 + if (disposer)
21 + discard_pipeline (disposer);
22 +}
23 +
24 struct pipeline_saver *
25 alloc_pipeline_saver ()
26 {
27 Index: bash-4.4/jobs.h
28 ===================================================================
29 --- bash-4.4.orig/jobs.h
30 +++ bash-4.4/jobs.h
31 @@ -190,6 +190,7 @@ extern JOB **jobs;
32 extern void making_children __P((void));
33 extern void stop_making_children __P((void));
34 extern void cleanup_the_pipeline __P((void));
35 +extern void discard_last_procsub_child __P((void));
36 extern void save_pipeline __P((int));
37 extern PROCESS *restore_pipeline __P((int));
38 extern void start_pipeline __P((void));
39 Index: bash-4.4/patchlevel.h
40 ===================================================================
41 --- bash-4.4.orig/patchlevel.h
42 +++ bash-4.4/patchlevel.h
43 @@ -25,6 +25,6 @@
44 regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh
45 looks for to find the patch level (for the sccs version string). */
46
47 -#define PATCHLEVEL 3
48 +#define PATCHLEVEL 4
49
50 #endif /* _PATCHLEVEL_H_ */
51 Index: bash-4.4/subst.c
52 ===================================================================
53 --- bash-4.4.orig/subst.c
54 +++ bash-4.4/subst.c
55 @@ -5808,10 +5808,7 @@ process_substitute (string, open_for_rea
56 {
57 #if defined (JOB_CONTROL)
58 if (last_procsub_child)
59 - {
60 - discard_pipeline (last_procsub_child);
61 - last_procsub_child = (PROCESS *)NULL;
62 - }
63 + discard_last_procsub_child ();
64 last_procsub_child = restore_pipeline (0);
65 #endif
66