Xref: utzoo comp.lang.c:35366 comp.unix.programmer:878 Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!spool2.mu.edu!sdd.hp.com!wuarchive!udel!haven!cs.wvu.wvnet.edu!cerc.wvu.wvnet.edu!cathedral!vrm From: vrm@cathedral.cerc.wvu.wvnet.edu (Vasile R. Montan) Newsgroups: comp.lang.c,comp.unix.programmer Subject: Catching termination of child process and system() call Keywords: fork wait system Message-ID: <1223@babcock.cerc.wvu.wvnet.edu> Date: 21 Jan 91 19:18:03 GMT Sender: news@cerc.wvu.wvnet.edu Followup-To: poster Lines: 27 I have a program which occasionally forks to do some processing. In order to avoid having zombie process hang around, I put the following in my main routine: void dowait() { wait(0); } main() { ... signal(SIGCHLD, dowait); ... } However, in another place in the code, I do a system call and look at the return status to see if an error has occurred. Without the signal in the main routine, the system call works fine, but with the signal, the system call always returns a -1. Is there an easy way to fix this? **************** The above opinions are mine, all mine. ***************** Vasile R. Montan Bell Atlantic Software Systems 9 South High Street vrm@cerc.wvu.wvnet.edu Morgantown, WV 26505