eiwd

no dbus iwd with iwctl functionality
git clone https://git.daat.foo/repos/eiwd.git
Log | Files | Refs | Submodules | README | LICENSE

commit 3a9b1f2e3852a0fbdd57cdb0ac704fc609e2bfcd
parent eab0731cb161ef319f7b034dc94998939ee7097e
Author: Denis Kenzior <denkenz@gmail.com>
Date:   Fri, 17 Aug 2018 11:52:47 -0500

device: Return an error if netdev_set_powered fails

netdev_set_powered could in theory return an error.  So handle this
case by returning an error from the property set call.

Diffstat:
Msrc/device.c | 9+++++++--
1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/device.c b/src/device.c @@ -2296,6 +2296,7 @@ static struct l_dbus_message *device_property_set_powered(struct l_dbus *dbus, struct device *device = user_data; bool powered; struct set_generic_cb_data *cb_data; + int r; if (!l_dbus_message_iter_get_variant(new_value, "b", &powered)) return dbus_error_invalid_args(message); @@ -2312,8 +2313,12 @@ static struct l_dbus_message *device_property_set_powered(struct l_dbus *dbus, cb_data->message = message; cb_data->complete = complete; - netdev_set_powered(device->netdev, powered, set_powered_cb, cb_data, - l_free); + r = netdev_set_powered(device->netdev, powered, set_powered_cb, + cb_data, l_free); + if (r < 0) { + l_free(cb_data); + return dbus_error_from_errno(r, message); + } return NULL; }