summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSamuel Mendoza-Jonas <sam@mendozajonas.com>2017-08-15 11:08:58 +1000
committerSamuel Mendoza-Jonas <sam@mendozajonas.com>2017-08-15 13:38:17 +1000
commit675eb751ff84e80f286da808daa931a84baf9302 (patch)
treed031580f676692f65de47a54ff1841cf4e307d7e
parent5b3dd56d982629349e612b9e984e65dec09b438f (diff)
downloadtalos-petitboot-675eb751ff84e80f286da808daa931a84baf9302.zip
talos-petitboot-675eb751ff84e80f286da808daa931a84baf9302.tar.gz
discover/device-handler: Be ready for user events earlier
Actions performed in network and udev init may result in pb-event callbacks (such as from udhcpc or pb-plugin), so make sure the user event interface is set up beforehand. Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
-rw-r--r--discover/device-handler.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/discover/device-handler.c b/discover/device-handler.c
index 94a3f1c..f1270c8 100644
--- a/discover/device-handler.c
+++ b/discover/device-handler.c
@@ -1563,6 +1563,10 @@ static void device_handler_update_lang(const char *lang)
static int device_handler_init_sources(struct device_handler *handler)
{
/* init our device sources: udev, network and user events */
+ handler->user_event = user_event_init(handler, handler->waitset);
+ if (!handler->user_event)
+ return -1;
+
handler->network = network_init(handler, handler->waitset,
handler->dry_run);
if (!handler->network)
@@ -1572,10 +1576,6 @@ static int device_handler_init_sources(struct device_handler *handler)
if (!handler->udev)
return -1;
- handler->user_event = user_event_init(handler, handler->waitset);
- if (!handler->user_event)
- return -1;
-
return 0;
}
OpenPOWER on IntegriCloud