dbus-execute: make transfer of CPUAffinity endian safe (#12711)

We store the affinity mask in the native endian. However, over D-Bus we
must transfer the mask in little endian byte order.

This is the second part of c367f996f5.
This commit is contained in:
Michal Sekletar 2019-05-31 15:23:23 +02:00 committed by Zbigniew Jędrzejewski-Szmek
parent aae3c9a075
commit 75e40119a4

View file

@ -214,12 +214,15 @@ static int property_get_cpu_affinity(
sd_bus_error *error) {
ExecContext *c = userdata;
_cleanup_free_ uint8_t *array = NULL;
size_t allocated;
assert(bus);
assert(reply);
assert(c);
return sd_bus_message_append_array(reply, 'y', c->cpu_set.set, c->cpu_set.allocated);
(void) cpu_set_to_dbus(&c->cpu_set, &array, &allocated);
return sd_bus_message_append_array(reply, 'y', array, allocated);
}
static int property_get_timer_slack_nsec(