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.
This commit is contained in:
Lennart Poettering
2013-12-13 04:06:43 +01:00
parent c5ef10429a
commit 7b77ed8cf3
6 changed files with 42 additions and 60 deletions
+3 -8
View File
@@ -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;
}