summaryrefslogtreecommitdiffstats
path: root/discover
diff options
context:
space:
mode:
authorJeremy Kerr <jk@ozlabs.org>2014-04-01 16:30:27 +0800
committerJeremy Kerr <jk@ozlabs.org>2014-04-01 16:41:08 +0800
commita574a72dcfea1bb61714754eca5612dde3632f0e (patch)
treed628c15962b27a04ced2b1877ddb20ae2a0243d3 /discover
parent0752a75d2e37243245dbd6dfd3e512c6f25eca8c (diff)
downloadtalos-petitboot-a574a72dcfea1bb61714754eca5612dde3632f0e.tar.gz
talos-petitboot-a574a72dcfea1bb61714754eca5612dde3632f0e.zip
discover/udev: don't propagate non-fatal errors from udev_process
Currently, we have a bug where non-zero return codes from udev_handle_dev_* cause the udev worker from deregistering from the waiter poll loop. This is becasue udev_process is propagating these errors, causing the deregistration. This change stops propagation of non-fatal errors, so we don't deregister. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Diffstat (limited to 'discover')
-rw-r--r--discover/udev.c13
1 files changed, 3 insertions, 10 deletions
diff --git a/discover/udev.c b/discover/udev.c
index 656c5ab..317b4bc 100644
--- a/discover/udev.c
+++ b/discover/udev.c
@@ -398,10 +398,8 @@ static int udev_process(void *arg)
struct udev_monitor *monitor = arg;
struct udev_device *dev;
const char *action;
- int result;
dev = udev_monitor_receive_device(monitor);
-
if (!dev) {
pb_log("udev_monitor_receive_device failed\n");
return -1;
@@ -411,17 +409,12 @@ static int udev_process(void *arg)
if (!action) {
pb_log("udev_device_get_action failed\n");
- goto fail;
+ } else {
+ udev_handle_dev_action(dev, action);
}
- result = udev_handle_dev_action(dev, action);
-
udev_device_unref(dev);
- return result;
-
-fail:
- udev_device_unref(dev);
- return -1;
+ return 0;
}
static void udev_log_fn(struct udev __attribute__((unused)) *udev,
OpenPOWER on IntegriCloud