Merge branch 'master', remote-tracking branch 'sami/ng'

This commit is contained in:
Craig Small
2011-10-20 22:15:27 +11:00
19 changed files with 569 additions and 131 deletions

View File

@@ -1112,15 +1112,13 @@ next_proc:
}
next_task:
for (;;) {
// fills in our path, plus x->tid and x->tgid
if ((!(PT->taskfinder(PT,&skel_p,x,path))) // simple_nexttid
|| (!(ret = PT->taskreader(PT,new_p,x,path)))) { // simple_readtask
goto next_proc;
}
if (!new_p) new_p = ret;
return ret;
// fills in our path, plus x->tid and x->tgid
if ((!(PT->taskfinder(PT,&skel_p,x,path))) // simple_nexttid
|| (!(ret = PT->taskreader(PT,new_p,x,path)))) { // simple_readtask
goto next_proc;
}
if (!new_p) new_p = ret;
return ret;
end_procs:
if (!saved_x) free(x);
@@ -1152,7 +1150,7 @@ PROCTAB* openproc(int flags, ...) {
PT->finder = listed_nextpid;
}else{
PT->procfs = opendir("/proc");
if(!PT->procfs) return NULL;
if(!PT->procfs) { free(PT); return NULL; }
PT->finder = simple_nextpid;
}
PT->flags = flags;

View File

@@ -214,7 +214,7 @@ void pretty_print_signals(void){
while(++i <= number_of_signals){
int n;
n = printf("%2d %s", i, signal_number_to_name(i));
if(i%7) printf(" \0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + n);
if(n>0 && i%7) printf(" \0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + n);
else printf("\n");
}
if((i-1)%7) printf("\n");

View File

@@ -312,11 +312,13 @@ int get_slabinfo(struct slab_info **list, struct slab_stat *stats)
if (!fgets(buffer, SLABINFO_VER_LEN, slabfile)) {
fprintf(stderr, "cannot read from slabinfo\n");
free(slabfile);
return 1;
}
if (sscanf(buffer, "slabinfo - version: %d.%d", &major, &minor) != 2) {
fprintf(stderr, "not the good old slabinfo we know\n");
free(slabfile);
return 1;
}
@@ -328,6 +330,7 @@ int get_slabinfo(struct slab_info **list, struct slab_stat *stats)
ret = parse_slabinfo10(list, stats, slabfile);
else {
fprintf(stderr, "unrecognizable slabinfo version\n");
free(slabfile);
return 1;
}

View File

@@ -856,8 +856,8 @@ unsigned int getdiskstat(struct disk_stat **disks, struct partition_stat **parti
break;
}
fields = sscanf(buff, " %*d %*d %*s %*u %*u %*u %*u %*u %*u %*u %*u %*u %*u %u", &dummy);
(*disks) = realloc(*disks, (cDisk+1)*sizeof(struct disk_stat));
if (fields == 1){
(*disks) = realloc(*disks, (cDisk+1)*sizeof(struct disk_stat));
sscanf(buff, " %*d %*d %15s %u %u %llu %u %u %u %llu %u %u %u %u",
//&disk_major,
//&disk_minor,