2
## 30_readproc_c.dpatch by Craig Small <csmall@debian.org>
4
## All lines beginning with `## DP:' are a description of the patch.
5
## DP: readproc.c some type conversion help
6
## DP: return if unable to open /proc
8
[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts
9
patch_opts="${patch_opts:--f --no-backup-if-mismatch}"
12
echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
16
-patch) patch $patch_opts -p1 < $0;;
17
-unpatch) patch $patch_opts -p1 -R < $0;;
19
echo >&2 "`basename $0`: script expects -patch|-unpatch as argum
26
--- procps-3.2.0.orig/proc/readproc.c
27
+++ procps-3.2.0/proc/readproc.c
29
// examine a field name (hash and compare)
31
if(unlikely(!*S)) break;
32
- entry = table[63 & (asso[S[3]] + asso[S[2]] + asso[S[0]])];
33
+ entry = table[63 & (asso[(int)S[3]] + asso[(int)S[2]] + asso[(int)S[0]])];
34
colon = strchr(S, ':');
35
if(unlikely(!colon)) break;
36
if(unlikely(colon[1]!='\t')) break;
43
do { /* read table: */
44
tab = xrealloc(tab, (n+1)*sizeof(proc_t*));/* realloc as we go, using */
45
tab[n] = readproc_direct(PT, NULL); /* final null to terminate */