sd-device: make sd_device_get_is_initialized() returns is_initialized by return value

This commit is contained in:
Yu Watanabe
2018-10-29 17:33:33 +09:00
parent 78ffb476f2
commit 5a937ea2f6
9 changed files with 28 additions and 33 deletions
+3 -3
View File
@@ -158,14 +158,14 @@ int dhcp_identifier_set_iaid(int ifindex, uint8_t *mac, size_t mac_len, void *_i
if (detect_container() <= 0) {
/* not in a container, udev will be around */
char ifindex_str[2 + DECIMAL_STR_MAX(int)];
int initialized, r;
int r;
sprintf(ifindex_str, "n%d", ifindex);
if (sd_device_new_from_device_id(&device, ifindex_str) >= 0) {
r = sd_device_get_is_initialized(device, &initialized);
r = sd_device_get_is_initialized(device);
if (r < 0)
return r;
if (!initialized)
if (r == 0)
/* not yet ready */
return -EBUSY;