From 7c4398615ecff16ee727edfa403c0b91bbd01066 Mon Sep 17 00:00:00 2001 From: Richard Hughes Date: Tue, 25 Oct 2022 10:50:47 +0100 Subject: [PATCH] trivial: Watch the plugin config even if there's no ->startup() --- libfwupdplugin/fu-plugin.c | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/libfwupdplugin/fu-plugin.c b/libfwupdplugin/fu-plugin.c index 85e6bcd7c..498ba4ff0 100644 --- a/libfwupdplugin/fu-plugin.c +++ b/libfwupdplugin/fu-plugin.c @@ -912,22 +912,23 @@ fu_plugin_runner_startup(FuPlugin *self, FuProgress *progress, GError **error) } /* optional */ - if (vfuncs->startup == NULL) - return TRUE; - g_debug("startup(%s)", fu_plugin_get_name(self)); - if (!vfuncs->startup(self, progress, &error_local)) { - if (error_local == NULL) { - g_critical("unset plugin error in startup(%s)", fu_plugin_get_name(self)); - g_set_error_literal(&error_local, - FWUPD_ERROR, - FWUPD_ERROR_INTERNAL, - "unspecified error"); - } - g_propagate_prefixed_error(error, - g_steal_pointer(&error_local), - "failed to startup using %s: ", + if (vfuncs->startup != NULL) { + g_debug("startup(%s)", fu_plugin_get_name(self)); + if (!vfuncs->startup(self, progress, &error_local)) { + if (error_local == NULL) { + g_critical("unset plugin error in startup(%s)", fu_plugin_get_name(self)); - return FALSE; + g_set_error_literal(&error_local, + FWUPD_ERROR, + FWUPD_ERROR_INTERNAL, + "unspecified error"); + } + g_propagate_prefixed_error(error, + g_steal_pointer(&error_local), + "failed to startup using %s: ", + fu_plugin_get_name(self)); + return FALSE; + } } /* create a monitor on the config file */