diff options
author | korbb <korbb@138bc75d-0d04-0410-961f-82ee72b054a4> | 1999-05-17 12:39:19 +0000 |
---|---|---|
committer | korbb <korbb@138bc75d-0d04-0410-961f-82ee72b054a4> | 1999-05-17 12:39:19 +0000 |
commit | 3e7a39cd8c18cd92f0b982ec7a80d25502deb5a4 (patch) | |
tree | ddbd94d637023a4d7751905b92b902f0c2d151b0 /gcc/fixinc/fixincl.c | |
parent | 95c0f4161029634d30c3751845e8e98053226d4d (diff) | |
download | gcc-3e7a39cd8c18cd92f0b982ec7a80d25502deb5a4.tar.gz |
Wait for children from chain_open()
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@26972 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fixinc/fixincl.c')
-rw-r--r-- | gcc/fixinc/fixincl.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/gcc/fixinc/fixincl.c b/gcc/fixinc/fixincl.c index 47c9ef1344a..f4d76bb1d15 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); } |