lsblk: use fallback for TYPE

... bug introduced by 1edd8af70b

Signed-off-by: Karel Zak <kzak@redhat.com>
This commit is contained in:
Karel Zak 2012-06-15 13:13:40 +02:00
parent aa323539cf
commit 9d738ff822
1 changed files with 7 additions and 2 deletions

View File

@ -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++)