lsblk: use fallback for TYPE
... bug introduced by 1edd8af70b
Signed-off-by: Karel Zak <kzak@redhat.com>
This commit is contained in:
parent
aa323539cf
commit
9d738ff822
|
@ -510,10 +510,15 @@ static char *get_type(struct blkdev_cxt *cxt)
|
|||
res = md_level ? md_level : xstrdup("md");
|
||||
|
||||
} else {
|
||||
const char *type = cxt->partition ? "part" : "disk";
|
||||
const char *type;
|
||||
int x = 0;
|
||||
|
||||
sysfs_read_int(&cxt->sysfs, "device/type", &x);
|
||||
res = blkdev_scsi_type_to_name(x);
|
||||
|
||||
type = blkdev_scsi_type_to_name(x);
|
||||
if (!type)
|
||||
type = cxt->partition ? "part" : "disk";
|
||||
res = xstrdup(type);
|
||||
}
|
||||
|
||||
for (p = res; p && *p; p++)
|
||||
|
|
Loading…
Reference in New Issue