[Pkg-net-snmp-commits] r220 - branches/net-snmp54/debian/patches
jochen at alioth.debian.org
jochen at alioth.debian.org
Tue Jan 29 13:58:41 UTC 2008
Author: jochen
Date: 2008-01-29 13:58:40 +0000 (Tue, 29 Jan 2008)
New Revision: 220
Added:
branches/net-snmp54/debian/patches/45_process_race.README
branches/net-snmp54/debian/patches/45_process_race.patch
Log:
Add upstream changeset 16704: fix process checking race condition
Added: branches/net-snmp54/debian/patches/45_process_race.README
===================================================================
--- branches/net-snmp54/debian/patches/45_process_race.README (rev 0)
+++ branches/net-snmp54/debian/patches/45_process_race.README 2008-01-29 13:58:40 UTC (rev 220)
@@ -0,0 +1,2 @@
+Upstream Changeset 16705: snmpd: PATCH: 1746831: from cunnijd: fix process
+checking race condition under Linux and platform #ifdefs
Added: branches/net-snmp54/debian/patches/45_process_race.patch
===================================================================
--- branches/net-snmp54/debian/patches/45_process_race.patch (rev 0)
+++ branches/net-snmp54/debian/patches/45_process_race.patch 2008-01-29 13:58:40 UTC (rev 220)
@@ -0,0 +1,48 @@
+diff -upr net-snmp-5.4.1/agent/mibgroup/ucd-snmp/proc.c net-snmp-5.4.1.patch/agent/mibgroup/ucd-snmp/proc.c
+--- net-snmp-5.4.1/agent/mibgroup/ucd-snmp/proc.c 2007-03-12 12:56:39.000000000 -0700
++++ net-snmp-5.4.1.patch/agent/mibgroup/ucd-snmp/proc.c 2007-09-20 09:55:35.000000000 -0700
+@@ -427,7 +427,7 @@ sh_count_procs(char *procname)
+ return count;
+ }
+
+-#elif OSTYPE == NETSNMP_LINUXID
++#elif NETSNMP_OSTYPE == NETSNMP_LINUXID
+
+ #include <dirent.h>
+ #include <fcntl.h>
+@@ -452,7 +452,7 @@ sh_count_procs(char *procname)
+ #ifdef USE_PROC_CMDLINE /* old method */
+ /* read /proc/XX/cmdline */
+ sprintf(cmdline,"/proc/%s/cmdline",ent->d_name);
+- if((fd = open(cmdline, O_RDONLY)) < 0) break;
++ if((fd = open(cmdline, O_RDONLY)) < 0) continue;
+ len = read(fd,cmdline,sizeof(cmdline) - 1);
+ close(fd);
+ if(len <= 0) continue;
+@@ -464,7 +464,7 @@ sh_count_procs(char *procname)
+ /* read /proc/XX/status */
+ sprintf(cmdline,"/proc/%s/status",ent->d_name);
+ if ((status = fopen(cmdline, "r")) == NULL)
+- break;
++ continue;
+ if (fgets(cmdline, sizeof(cmdline), status) == NULL) {
+ fclose(status);
+ break;
+@@ -507,7 +507,7 @@ sh_count_procs(char *procname)
+ return total;
+ }
+
+-#elif OSTYPE == NETSNMP_ULTRIXID
++#elif NETSNMP_OSTYPE == NETSNMP_ULTRIXID
+
+ #define NPROCS 32 /* number of proces to read at once */
+
+@@ -688,7 +688,7 @@ getstruct(off_t loc, char *name, off_t d
+ return (0);
+ return (1);
+ }
+-#elif OSTYPE == NETSNMP_SOLARISID
++#elif NETSNMP_OSTYPE == NETSNMP_SOLARISID
+
+ #ifdef _SLASH_PROC_METHOD_
+
More information about the Pkg-net-snmp-commits
mailing list