Return if unable to open /proc
A patch from Debian.
Backported-by: Sami Kerola <kerolasa@iki.fi>
// examine a field name (hash and compare)
base:
if(unlikely(!*S)) break;
- entry = table[63 & (asso[S[3]] + asso[S[2]] + asso[S[0]])];
+ entry = table[63 & (asso[(int)S[3]] + asso[(int)S[2]] + asso[(int)S[0]])];
colon = strchr(S, ':');
if(unlikely(!colon)) break;
if(unlikely(colon[1]!='\t')) break;
else
PT = openproc(flags);
va_end(ap);
+ if (!PT)
+ return 0;
do { /* read table: */
tab = xrealloc(tab, (n+1)*sizeof(proc_t*));/* realloc as we go, using */
tab[n] = readproc_direct(PT, NULL); /* final null to terminate */