udev-builtin-net_id: reading phys_port_name may be refused with EOPNOTSUPP

If reading the sysattr failed with such error, the whole operation in
net_id builtin command will fail, and the interface will not be renamed.

Fixes a bug introduced by 5bbcfbaa11.
This commit is contained in:
Yu Watanabe 2022-10-04 15:29:25 +09:00
parent f77c0840d5
commit e6766c538a

View file

@ -1082,9 +1082,7 @@ static int get_link_info(sd_device *dev, LinkInfo *info) {
if (r < 0 && r != -ENOENT)
return r;
r = sd_device_get_sysattr_value(dev, "phys_port_name", &info->phys_port_name);
if (r < 0 && r != -ENOENT)
return r;
(void) sd_device_get_sysattr_value(dev, "phys_port_name", &info->phys_port_name);
r = sd_device_get_sysattr_value(dev, "address", &s);
if (r < 0 && r != -ENOENT)