parser_init();
+ if (config_get()->safe_mode)
+ return handler;
+
rc = device_handler_init_sources(handler);
if (rc) {
talloc_free(handler);
void device_handler_update_config(struct device_handler *handler,
struct config *config)
{
- config_set(config);
+ int rc;
+
+ rc = config_set(config);
+ if (rc)
+ return;
+
discover_server_notify_config(handler->server, config);
device_handler_reinit(handler);
}
static void device_handler_reinit_sources(struct device_handler *handler)
{
+ /* if we haven't initialised sources previously (becuase we started in
+ * safe mode), then init once here. */
+ if (!(handler->udev || handler->network || handler->user_event)) {
+ device_handler_init_sources(handler);
+ return;
+ }
+
udev_reinit(handler->udev);
network_shutdown(handler->network);