fix if disk has no volume group
This commit is contained in:
parent
7362619bc1
commit
8e420228a1
|
@ -1394,8 +1394,12 @@ static int create_diskmap(sigar_t *sigar)
|
||||||
while ((ptr = fgets(buffer, sizeof(buffer), fp))) {
|
while ((ptr = fgets(buffer, sizeof(buffer), fp))) {
|
||||||
FILE *lfp;
|
FILE *lfp;
|
||||||
char cmd[256], disk[56];
|
char cmd[256], disk[56];
|
||||||
char *s = strchr(ptr, ' ');
|
char *s;
|
||||||
if (s) {
|
|
||||||
|
if (strstr(ptr, " None")) {
|
||||||
|
continue; /* no volume group */
|
||||||
|
}
|
||||||
|
if ((s = strchr(ptr, ' '))) {
|
||||||
*s = '\0';
|
*s = '\0';
|
||||||
}
|
}
|
||||||
strcpy(disk, ptr);
|
strcpy(disk, ptr);
|
||||||
|
|
Loading…
Reference in New Issue