Commit 47497dd2 authored by Jan Rybar's avatar Jan Rybar

- Fixing sysinfo - devices with length exceeding 15 chars are not displayed in vmstat -d

parent ee1fd80f
......@@ -951,7 +951,7 @@ unsigned int getdiskstat(struct disk_stat **disks, struct partition_stat **parti
int cPartition = 0;
int fields;
unsigned dummy;
char devname[32];
char devname[35];
*disks = NULL;
*partitions = NULL;
......@@ -964,10 +964,10 @@ unsigned int getdiskstat(struct disk_stat **disks, struct partition_stat **parti
fclose(fd);
break;
}
fields = sscanf(buff, " %*d %*d %15s %*u %*u %*u %*u %*u %*u %*u %*u %*u %*u %u", devname, &dummy);
fields = sscanf(buff, " %*d %*d %34s %*u %*u %*u %*u %*u %*u %*u %*u %*u %*u %u", devname, &dummy);
if (fields == 2 && is_disk(devname)){
(*disks) = xrealloc(*disks, (cDisk+1)*sizeof(struct disk_stat));
sscanf(buff, " %*d %*d %15s %u %u %llu %u %u %u %llu %u %u %u %u",
sscanf(buff, " %*d %*d %31s %u %u %llu %u %u %u %llu %u %u %u %u",
//&disk_major,
//&disk_minor,
(*disks)[cDisk].disk_name,
......@@ -989,8 +989,8 @@ unsigned int getdiskstat(struct disk_stat **disks, struct partition_stat **parti
(*partitions) = xrealloc(*partitions, (cPartition+1)*sizeof(struct partition_stat));
fflush(stdout);
sscanf(buff, (fields == 2)
? " %*d %*d %15s %u %*u %llu %*u %u %*u %llu %*u %*u %*u %*u"
: " %*d %*d %15s %u %llu %u %llu",
? " %*d %*d %34s %u %*u %llu %*u %u %*u %llu %*u %*u %*u %*u"
: " %*d %*d %34s %u %llu %u %llu",
//&part_major,
//&part_minor,
(*partitions)[cPartition].partition_name,
......
......@@ -101,7 +101,7 @@ extern void vminfo(void);
typedef struct disk_stat{
unsigned long long reads_sectors;
unsigned long long written_sectors;
char disk_name [16];
char disk_name [32];
unsigned inprogress_IO;
unsigned merged_reads;
unsigned merged_writes;
......@@ -115,7 +115,7 @@ typedef struct disk_stat{
}disk_stat;
typedef struct partition_stat{
char partition_name [16];
char partition_name [35];
unsigned long long reads_sectors;
unsigned parent_disk; // index into a struct disk_stat array
unsigned reads;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment