lsblk: use ID_MODEL_ENC is possible
Fix: https://github.com/karelzak/util-linux/issues/1098 Signed-off-by: Karel Zak <kzak@redhat.com>
This commit is contained in:
parent
0e54ac3980
commit
1775aaf1d7
|
@ -10,6 +10,7 @@
|
||||||
#include "mangle.h"
|
#include "mangle.h"
|
||||||
#include "path.h"
|
#include "path.h"
|
||||||
#include "nls.h"
|
#include "nls.h"
|
||||||
|
#include "strutils.h"
|
||||||
|
|
||||||
#include "lsblk.h"
|
#include "lsblk.h"
|
||||||
|
|
||||||
|
@ -114,7 +115,11 @@ static struct lsblk_devprop *get_properties_by_udev(struct lsblk_device *ld)
|
||||||
if (data)
|
if (data)
|
||||||
prop->serial = xstrdup(data);
|
prop->serial = xstrdup(data);
|
||||||
|
|
||||||
if ((data = udev_device_get_property_value(dev, "ID_MODEL")))
|
if ((data = udev_device_get_property_value(dev, "ID_MODEL_ENC"))) {
|
||||||
|
prop->model = xstrdup(data);
|
||||||
|
unhexmangle_string(prop->model);
|
||||||
|
normalize_whitespace((unsigned char *) prop->model);
|
||||||
|
} else if ((data = udev_device_get_property_value(dev, "ID_MODEL")))
|
||||||
prop->model = xstrdup(data);
|
prop->model = xstrdup(data);
|
||||||
|
|
||||||
udev_device_unref(dev);
|
udev_device_unref(dev);
|
||||||
|
|
Loading…
Reference in New Issue