Wait for children from chain_open()
authorRainer Orth <ro@TechFak.Uni-Bielefeld.DE>
Mon, 17 May 1999 12:39:19 +0000 (12:39 +0000)
committerBruce Korb <korbb@gcc.gnu.org>
Mon, 17 May 1999 12:39:19 +0000 (12:39 +0000)
From-SVN: r26972

gcc/ChangeLog
gcc/fixinc/fixincl.c
gcc/fixinc/inclhack.tpl

index 0a38aef0ebdb54de2864880742e26593af5601b8..97a7e39d497cf3229fac23283054d4bac0adace8 100644 (file)
@@ -1,3 +1,10 @@
+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>
 
        * tree.def (TYPE_NONCOPIED_PARTS): Revise documentation to match
index 47c9ef1344af41e2d1bbe0d43ce0aa1ce009ae25..f4d76bb1d15f046fdf35a606ba5ca3a74c601c30 100644 (file)
@@ -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);
 }
index c2b3b513f30d45e34750d40460b1b37b4cc719cd..f5153bf089257f286ac940eb676ef17594efb8b2 100644 (file)
@@ -405,7 +405,7 @@ echo 'Removing unneeded directories:'
 cd $LIB
 all_dirs=`find . -type d -print | sort -r`
 for file in $all_dirs; do
-  rmdir $LIB/$file > /dev/null 2>&1 | :
+  rmdir $LIB/$file > /dev/null 2>&1
 done
 
 # # # # # # # # # # # # # # # # # # # # #