~ubuntu-branches/ubuntu/precise/net-snmp/precise

« back to all changes in this revision

Viewing changes to debian/patches/45_process_race.patch

  • Committer: Bazaar Package Importer
  • Author(s): Chuck Short
  • Date: 2009-11-26 01:27:00 UTC
  • mfrom: (1.1.9 sid)
  • Revision ID: james.westby@ubuntu.com-20091126012700-pox7w0a5j2x305h9
Tags: 5.4.2.1~dfsg-3ubuntu1
* Merge from debian testing.  Remaining changes:
  - Set Ubuntu maintainer address.
  - net-snmp-config: Use bash. (LP: #104738)
  - Removed multiuser option when calling update-rc.d. (LP: #254261)
  - debian/snmpd.init: LSBify the init script.
  - debian/patches/52_fix_snmpcmd_1_typo.patch: Adjust a typo in snmpcmd.1
    (LP: #250459)
  - debian/patches/99-fix-ubuntu-div0.patch: Fix dvision by zero.
    (LP: #426813).
 * Dropped patches:
   - debian/patches/101-fix-ipalias.patch: Applied upstream.
   - debian/patches/99-fix-net-snmp-syslog.patch: Applied upstream.
   - debian/patches/99-fix-perl-counter-in-subagent.patch: Applied upstream.
   - ebian/patches/103-fix-ubuntu-lmsensors.patch: No longer needed.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
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
2
 
--- net-snmp-5.4.1/agent/mibgroup/ucd-snmp/proc.c       2007-03-12 12:56:39.000000000 -0700
3
 
+++ net-snmp-5.4.1.patch/agent/mibgroup/ucd-snmp/proc.c 2007-09-20 09:55:35.000000000 -0700
4
 
@@ -427,7 +427,7 @@ sh_count_procs(char *procname)
5
 
     return count;
6
 
 }
7
 
 
8
 
-#elif OSTYPE == NETSNMP_LINUXID
9
 
+#elif NETSNMP_OSTYPE == NETSNMP_LINUXID
10
 
 
11
 
 #include <dirent.h>
12
 
 #include <fcntl.h>
13
 
@@ -452,7 +452,7 @@ sh_count_procs(char *procname)
14
 
 #ifdef USE_PROC_CMDLINE  /* old method */
15
 
       /* read /proc/XX/cmdline */
16
 
       sprintf(cmdline,"/proc/%s/cmdline",ent->d_name);
17
 
-      if((fd = open(cmdline, O_RDONLY)) < 0) break;
18
 
+      if((fd = open(cmdline, O_RDONLY)) < 0) continue;
19
 
       len = read(fd,cmdline,sizeof(cmdline) - 1);
20
 
       close(fd);
21
 
       if(len <= 0) continue;
22
 
@@ -464,7 +464,7 @@ sh_count_procs(char *procname)
23
 
       /* read /proc/XX/status */
24
 
       sprintf(cmdline,"/proc/%s/status",ent->d_name);
25
 
       if ((status = fopen(cmdline, "r")) == NULL)
26
 
-          break;
27
 
+          continue;
28
 
       if (fgets(cmdline, sizeof(cmdline), status) == NULL) {
29
 
           fclose(status);
30
 
           break;
31
 
@@ -507,7 +507,7 @@ sh_count_procs(char *procname)
32
 
     return total;
33
 
 }
34
 
 
35
 
-#elif OSTYPE == NETSNMP_ULTRIXID
36
 
+#elif NETSNMP_OSTYPE == NETSNMP_ULTRIXID
37
 
 
38
 
 #define        NPROCS          32      /* number of proces to read at once */
39
 
 
40
 
@@ -688,7 +688,7 @@ getstruct(off_t loc, char *name, off_t d
41
 
         return (0);
42
 
     return (1);
43
 
 }
44
 
-#elif OSTYPE == NETSNMP_SOLARISID
45
 
+#elif NETSNMP_OSTYPE == NETSNMP_SOLARISID
46
 
 
47
 
 #ifdef _SLASH_PROC_METHOD_
48