valgrind freaked out on some weird old code

This commit is contained in:
albert 2005-01-24 03:37:41 +00:00
parent 0908258da6
commit 37b9b9a235
3 changed files with 16 additions and 1 deletions

View File

@ -725,7 +725,7 @@ proc_t* readproc(PROCTAB *restrict const PT, proc_t *restrict p) {
proc_t *ret;
proc_t *saved_p;
if (PT->did_fake) PT->did_fake=0;
PT->did_fake=0;
// if (PT->taskdir) {
// closedir(PT->taskdir);
// PT->taskdir = NULL;

View File

@ -1260,6 +1260,7 @@ static const format_struct format_array[] = {
{"cpuid", "CPUID", pr_psr, sr_nop, 5, 0, BSD, TO|RIGHT}, // OpenBSD: 8 wide!
{"cputime", "TIME", pr_time, sr_nop, 8, 0, DEC, ET|RIGHT}, /*time*/
{"cstime", "-", pr_nop, sr_cstime, 1, 0, LNX, AN|RIGHT},
{"ctid", "CTID", pr_nop, sr_nop, 5, 0, SUN, ET|RIGHT}, // resource contracts?
{"cursig", "CURSIG", pr_nop, sr_nop, 6, 0, DEC, AN|RIGHT},
{"cutime", "-", pr_nop, sr_cutime, 1, 0, LNX, AN|RIGHT},
{"cwd", "CWD", pr_nop, sr_nop, 3, 0, LNX, AN|LEFT},
@ -1357,6 +1358,8 @@ static const format_struct format_array[] = {
{"priority", "PRI", pr_priority, sr_priority, 3, 0, LNX, TO|RIGHT},
{"prmgrp", "PRMGRP", pr_nop, sr_nop, 12, 0, HPU, PO|RIGHT},
{"prmid", "PRMID", pr_nop, sr_nop, 12, 0, HPU, PO|RIGHT},
{"project", "PROJECT", pr_nop, sr_nop, 12, 0, SUN, PO|LEFT}, // see prm* andctid
{"projid", "PROJID", pr_nop, sr_nop, 5, 0, SUN, PO|RIGHT},
{"pset", "PSET", pr_nop, sr_nop, 4, 0, DEC, TO|RIGHT},
{"psr", "PSR", pr_psr, sr_nop, 3, 0, DEC, TO|RIGHT},
{"psxpri", "PPR", pr_nop, sr_nop, 3, 0, DEC, TO|RIGHT},
@ -1411,6 +1414,7 @@ static const format_struct format_array[] = {
{"svuser", "SVUSER", pr_suser, sr_suser, 8, USR, LNX, ET|USER},
{"systime", "SYSTEM", pr_nop, sr_nop, 6, 0, DEC, ET|RIGHT},
{"sz", "SZ", pr_sz, sr_nop, 5, 0, HPU, PO|RIGHT},
{"taskid", "TASKID", pr_nop, sr_nop, 5, 0, SUN, TO|PIDMAX|RIGHT}, // is this a thread ID?
{"tdev", "TDEV", pr_nop, sr_nop, 4, 0, XXX, AN|RIGHT},
{"thcount", "THCNT", pr_nlwp, sr_nlwp, 5, 0, AIX, PO|RIGHT},
{"tid", "TID", pr_thread, sr_tid, 5, 0, AIX, TO|PIDMAX|RIGHT},
@ -1453,6 +1457,8 @@ static const format_struct format_array[] = {
{"wchan", "WCHAN", pr_wchan, sr_wchan, 6, WCH, XXX, TO|WCHAN}, /* BSD n forces this to nwchan */ /* was 10 wide */
{"wname", "WCHAN", pr_wname, sr_nop, 6, WCH, SGI, TO|WCHAN}, /* opposite of nwchan */
{"xstat", "XSTAT", pr_nop, sr_nop, 5, 0, BSD, AN|RIGHT},
{"zone", "ZONE", pr_context, sr_nop, 31, 0, SUN, ET|LEFT}, // Solaris zone == Linux context?
{"zoneid", "ZONEID", pr_nop, sr_nop, 31, 0, SUN, ET|RIGHT},// Linux only offers context names
{"~", "-", pr_nop, sr_nop, 1, 0, LNX, AN|RIGHT} /* NULL would ruin alphabetical order */
};

View File

@ -478,6 +478,15 @@ static const char *parse_sysv_option(void){
trace("-z shows aliased MAC info\n");
format_modifiers |= FM_M;
break;
// Solaris 10 does this
case 'z': /* select by zone */
trace("-z secects by zone\n");
arg=get_opt_arg();
if(!arg) return "List of zones (contexts, labels, whatever?) must follow -z.";
err=parse_list(arg, parse_zone);
if(err) return err;
selection_list->typecode = SEL_ZONE;
return NULL; /* can't have any more options */
#endif
case '-':
return "Embedded '-' among SysV options makes no sense.";