mirror of
https://github.com/systemd/systemd.git
synced 2025-01-10 05:18:17 +03:00
hostnamed: trivial optimization
This commit is contained in:
parent
1d2bf1f0ee
commit
e6fccf029b
@ -185,15 +185,16 @@ static int get_dmi_data(const char *database_key, const char *regular_key, char
|
||||
if (!s && regular_key)
|
||||
(void) sd_device_get_property_value(device, regular_key, &s);
|
||||
|
||||
if (!ret)
|
||||
return !!s;
|
||||
|
||||
if (s) {
|
||||
b = strdup(s);
|
||||
if (!b)
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
if (ret)
|
||||
*ret = TAKE_PTR(b);
|
||||
|
||||
*ret = TAKE_PTR(b);
|
||||
return !!s;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user