This is a +1 bugfix for me.
ID: 3053428
Last Update: Attachment added ( takevos )
Details:
get_pid_from_inode returns the last pid found in /proc/ when the inode
of a socket can not be found. Moving the following line to the place
where an inode match has been detected solves this problem, as the pid
was already set to zero at the beginning of the function: pid =
strtoul(procinfo->d_name, NULL, 0);
This was tested on:
Distributor ID: Ubuntu
Description: Ubuntu 9.04
Release: 9.04
Codename: jaunty
--- agent/mibgroup/util_funcs/get_pid_from_inode.c (revision 123164)
+++ agent/mibgroup/util_funcs/get_pid_from_inode.c (working copy)
@@ -53,8 +53,6 @@
if (filelen <= 0 || PATH_MAX < filelen)
continue;
- pid = strtoul(procinfo->d_name, NULL, 0);
-
if (!(piddirs = opendir(path_name)))
continue;
@@ -77,6 +75,7 @@
} else
temp_inode = 0;
if (inode == temp_inode) {
+ pid = strtoul(procinfo->d_name, NULL, 0);
iflag = 1;
break;
}
--
Wes Hardaker
Please mail all replies to [email protected]
------------------------------------------------------------------------------
This SF.net Dev2Dev email is sponsored by:
Show off your parallel programming skills.
Enter the Intel(R) Threading Challenge 2010.
http://p.sf.net/sfu/intel-thread-sfd
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders