components/net-snmp-57/patches/063.17949399.patch
author Gowtham Thommandra <Gowtham.Thommandra@Oracle.COM>
Wed, 27 Apr 2016 22:46:14 -0700
changeset 5869 d4a72a69caa0
permissions -rw-r--r--
17949399 net-snmp does not replicate all threads to the daemon process

# Developed in-house. Submitted upstream
# https://sourceforge.net/p/net-snmp/bugs/2587/
# Need to use forkall() to fork all the threads. Otherwise the threads
# for FM MIB etc will not be spawned causing failures during snmpwalk
--- net-snmp/snmplib/system.c	Tue Oct  9 15:28:58 2012
+++ net-snmp/snmplib/system.c	Mon Dec  2 23:36:52 2013
@@ -283,7 +283,7 @@
      * Fork to return control to the invoking process and to
      * guarantee that we aren't a process group leader.
      */
-    i = fork();
+    i = forkall();
     if (i != 0) {
         /* Parent. */
         DEBUGMSGT(("daemonize","first fork returned %d.\n", i));
@@ -305,7 +305,7 @@
         /*
          * Fork to let the process/session group leader exit.
          */
-        if ((i = fork()) != 0) {
+        if ((i = forkall()) != 0) {
             DEBUGMSGT(("daemonize","second fork returned %d.\n", i));
             if(i == -1) {
                 snmp_log(LOG_ERR,"second fork failed (errno %d) in "