summaryrefslogtreecommitdiff
path: root/src/network
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2013-12-13 03:30:42 +0100
committerLennart Poettering <lennart@poettering.net>2013-12-13 04:06:43 +0100
commit7b77ed8cf36e8eca6017791626044b61ae2d68e7 (patch)
treeb9315db260bbd82cfbc4ae7cd736d9d8df65f626 /src/network
parentc5ef10429a7768e3453f29e8c85cb560ce382649 (diff)
event: be more conservative when returning errors from event handler callbacks
We really should return errors from event handlers if we have a continous problem and don't know any other solution.
Diffstat (limited to 'src/network')
-rw-r--r--src/network/networkd-manager.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/src/network/networkd-manager.c b/src/network/networkd-manager.c
index d59b9139a3..1b5837e42c 100644
--- a/src/network/networkd-manager.c
+++ b/src/network/networkd-manager.c
@@ -22,6 +22,7 @@
#include "path-util.h"
#include "networkd.h"
#include "libudev-private.h"
+#include "udev-util.h"
int manager_new(Manager **ret) {
_cleanup_manager_free_ Manager *m = NULL;
@@ -204,19 +205,13 @@ finish:
static int manager_dispatch_link_udev(sd_event_source *source, int fd, uint32_t revents, void *userdata) {
Manager *m = userdata;
struct udev_monitor *monitor = m->udev_monitor;
- struct udev_device *device;
- int r;
+ _cleanup_udev_device_unref_ struct udev_device *device = NULL;
device = udev_monitor_receive_device(monitor);
if (!device)
return -ENOMEM;
- r = manager_process_link(m, device);
- if (r < 0)
- return r;
-
- udev_device_unref(device);
-
+ manager_process_link(m, device);
return 0;
}