On Mon, 20 Sep 2004 12:30:35 +0800 Jim wrote:
JS>     I do have the waitpid() routine inside the sa_handler of the daemon
JS>     which the snmpd get value from. The waitpid is as following - if
JS>     (waitpid(-1, &status, WNOHANG) < 0) { return; }

That is your problem. WNOHANG means don't wait for a child that hasn't exited
yet, and will return immediately if the child is still running. And specifying
a parameter of -1 will wait for any child, not necessarily the one you just
ran. Either take out WNOHANG to actually wait for the child to complete, or
periodically call waitpid as you do above to reap defunct processes.


-- 
Robert Story; NET-SNMP Junkie <http://www.net-snmp.org/>
<irc://irc.freenode.net/#net-snmp>  
Archive: <http://sourceforge.net/mailarchive/forum.php?forum=net-snmp-users>

You are lost in a twisty maze of little standards, all different. 


-------------------------------------------------------
This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170
Project Admins to receive an Apple iPod Mini FREE for your judgement on
who ports your project to Linux PPC the best. Sponsored by IBM.
Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php
_______________________________________________
Net-snmp-users mailing list
[EMAIL PROTECTED]
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users

Reply via email to