On Sat, Oct 15, 2011 at 03:46:51PM -0500, Dale Rahn wrote: > I first wrote this a while back but it got lost in my trees after I > updated to a recent snapshot I noticed I was out of processes again, > that I had > 50 zombie processes sitting around. > > I use usbhidaction to play/stop/skip music playing on my desktop > controlling xmms. > > Without this patch, each time a key was pressed and xmms ran/exited it > would leave another zombie process. > So, I recieved some feedback about this, here is what should be a much better fix.
Index: usbhidaction.c =================================================================== RCS file: /cvs/src/usr.bin/usbhidaction/usbhidaction.c,v retrieving revision 1.15 diff -u -p -r1.15 usbhidaction.c --- usbhidaction.c 7 Mar 2011 14:59:06 -0000 1.15 +++ usbhidaction.c 15 Oct 2011 21:08:34 -0000 @@ -160,6 +160,9 @@ main(int argc, char **argv) (void)signal(SIGHUP, sighup); + /* ignore the signal, allows init to reap any children that exit */ + (void)signal(SIGCHLD, SIG_IGN); + if (demon) { if (daemon(0, 0) < 0) err(1, "daemon()"); Dale Rahn dr...@dalerahn.com