Commit 9f8eec39 by Rainer Orth Committed by Bruce Korb

Wait for children from chain_open()

From-SVN: r26972
parent a32c71a5
Mon May 17 19:45:41 1999 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
* fixinc/fixincl.c (process): Wait for children from chain_open()
to avoid creating zombies.
* fixinc/inclhack.tpl: Removed no-op pipe.
Mon May 17 07:23:34 1999 Mark Mitchell <mark@codesourcery.com> Mon May 17 07:23:34 1999 Mark Mitchell <mark@codesourcery.com>
* tree.def (TYPE_NONCOPIED_PARTS): Revise documentation to match * tree.def (TYPE_NONCOPIED_PARTS): Revise documentation to match
......
...@@ -938,6 +938,7 @@ process (pz_data, pz_file_name) ...@@ -938,6 +938,7 @@ process (pz_data, pz_file_name)
tFixDesc *p_fixd = fixDescList; tFixDesc *p_fixd = fixDescList;
int todo_ct = FIX_COUNT; int todo_ct = FIX_COUNT;
t_fd_pair fdp = { -1, -1 }; t_fd_pair fdp = { -1, -1 };
int num_children = 0;
/* IF this is the first time through, /* IF this is the first time through,
THEN put the 'file' environment variable into the environment. THEN put the 'file' environment variable into the environment.
...@@ -1086,6 +1087,7 @@ process (pz_data, pz_file_name) ...@@ -1086,6 +1087,7 @@ process (pz_data, pz_file_name)
if (fd != -1) if (fd != -1)
{ {
fdp.read_fd = fd; fdp.read_fd = fd;
num_children++;
break; break;
} }
...@@ -1172,4 +1174,9 @@ process (pz_data, pz_file_name) ...@@ -1172,4 +1174,9 @@ process (pz_data, pz_file_name)
fclose (in_fp); fclose (in_fp);
} }
close (fdp.read_fd); /* probably redundant, but I'm paranoid */ 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);
} }
...@@ -405,7 +405,7 @@ echo 'Removing unneeded directories:' ...@@ -405,7 +405,7 @@ echo 'Removing unneeded directories:'
cd $LIB cd $LIB
all_dirs=`find . -type d -print | sort -r` all_dirs=`find . -type d -print | sort -r`
for file in $all_dirs; do for file in $all_dirs; do
rmdir $LIB/$file > /dev/null 2>&1 | : rmdir $LIB/$file > /dev/null 2>&1
done done
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment