aboutsummaryrefslogtreecommitdiff
path: root/gcc/fixinc/fixincl.c
diff options
context:
space:
mode:
authorRainer Orth <ro@TechFak.Uni-Bielefeld.DE>1999-05-17 12:39:19 +0000
committerBruce Korb <korbb@gcc.gnu.org>1999-05-17 12:39:19 +0000
commit9f8eec3979d03f1813ee352834c1199b0891a242 (patch)
treeddbd94d637023a4d7751905b92b902f0c2d151b0 /gcc/fixinc/fixincl.c
parenta32c71a53887042347be3d8ac155d056d249cf54 (diff)
downloadgcc-9f8eec3979d03f1813ee352834c1199b0891a242.zip
gcc-9f8eec3979d03f1813ee352834c1199b0891a242.tar.gz
gcc-9f8eec3979d03f1813ee352834c1199b0891a242.tar.bz2
Wait for children from chain_open()
From-SVN: r26972
Diffstat (limited to 'gcc/fixinc/fixincl.c')
-rw-r--r--gcc/fixinc/fixincl.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/gcc/fixinc/fixincl.c b/gcc/fixinc/fixincl.c
index 47c9ef134..f4d76bb 100644
--- a/gcc/fixinc/fixincl.c
+++ b/gcc/fixinc/fixincl.c
@@ -938,6 +938,7 @@ process (pz_data, pz_file_name)
tFixDesc *p_fixd = fixDescList;
int todo_ct = FIX_COUNT;
t_fd_pair fdp = { -1, -1 };
+ int num_children = 0;
/* IF this is the first time through,
THEN put the 'file' environment variable into the environment.
@@ -1086,6 +1087,7 @@ process (pz_data, pz_file_name)
if (fd != -1)
{
fdp.read_fd = fd;
+ num_children++;
break;
}
@@ -1172,4 +1174,9 @@ process (pz_data, pz_file_name)
fclose (in_fp);
}
close (fdp.read_fd); /* probably redundant, but I'm paranoid */
+
+ /* Wait for child processes created by chain_open()
+ to avoid creating zombies. */
+ while (--num_children >= 0)
+ wait ((int *) NULL);
}