mirror of
https://github.com/systemd/systemd-stable.git
synced 2024-10-27 01:55:32 +03:00
property callback returns are consistent
It is no different to return 0 over 1 in the property callback. It is confusing to return 1 which made me think 1 has a special purpose. This way code is consistent with the rest of the tree.
This commit is contained in:
parent
9a50ce20ef
commit
0f82610153
@ -103,11 +103,7 @@ static int property_get_sessions(
|
||||
|
||||
}
|
||||
|
||||
r = sd_bus_message_close_container(reply);
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
return 1;
|
||||
return sd_bus_message_close_container(reply);
|
||||
}
|
||||
|
||||
static int property_get_idle_hint(
|
||||
|
@ -61,11 +61,7 @@ static int property_get_id(
|
||||
assert(reply);
|
||||
assert(m);
|
||||
|
||||
r = sd_bus_message_append_array(reply, 'y', &m->id, 16);
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
return 1;
|
||||
return sd_bus_message_append_array(reply, 'y', &m->id, 16);
|
||||
}
|
||||
|
||||
static int property_get_state(
|
||||
@ -112,11 +108,7 @@ static int property_get_netif(
|
||||
|
||||
assert_cc(sizeof(int) == sizeof(int32_t));
|
||||
|
||||
r = sd_bus_message_append_array(reply, 'i', m->netif, m->n_netif * sizeof(int));
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
return 1;
|
||||
return sd_bus_message_append_array(reply, 'i', m->netif, m->n_netif * sizeof(int));
|
||||
}
|
||||
|
||||
static BUS_DEFINE_PROPERTY_GET_ENUM(property_get_class, machine_class, MachineClass);
|
||||
|
@ -53,11 +53,7 @@ static int property_get_ether_addrs(
|
||||
return r;
|
||||
}
|
||||
|
||||
r = sd_bus_message_close_container(reply);
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
return 1;
|
||||
return sd_bus_message_close_container(reply);
|
||||
}
|
||||
|
||||
const sd_bus_vtable network_vtable[] = {
|
||||
|
Loading…
Reference in New Issue
Block a user