trivial: Watch the plugin config even if there's no ->startup()

This commit is contained in:
Richard Hughes 2022-10-25 10:50:47 +01:00 committed by Mario Limonciello
parent 5987a9691a
commit 7c4398615e

View File

@ -912,12 +912,12 @@ fu_plugin_runner_startup(FuPlugin *self, FuProgress *progress, GError **error)
} }
/* optional */ /* optional */
if (vfuncs->startup == NULL) if (vfuncs->startup != NULL) {
return TRUE;
g_debug("startup(%s)", fu_plugin_get_name(self)); g_debug("startup(%s)", fu_plugin_get_name(self));
if (!vfuncs->startup(self, progress, &error_local)) { if (!vfuncs->startup(self, progress, &error_local)) {
if (error_local == NULL) { if (error_local == NULL) {
g_critical("unset plugin error in startup(%s)", fu_plugin_get_name(self)); g_critical("unset plugin error in startup(%s)",
fu_plugin_get_name(self));
g_set_error_literal(&error_local, g_set_error_literal(&error_local,
FWUPD_ERROR, FWUPD_ERROR,
FWUPD_ERROR_INTERNAL, FWUPD_ERROR_INTERNAL,
@ -929,6 +929,7 @@ fu_plugin_runner_startup(FuPlugin *self, FuProgress *progress, GError **error)
fu_plugin_get_name(self)); fu_plugin_get_name(self));
return FALSE; return FALSE;
} }
}
/* create a monitor on the config file */ /* create a monitor on the config file */
priv->config_monitor = g_file_monitor_file(file, G_FILE_MONITOR_NONE, NULL, error); priv->config_monitor = g_file_monitor_file(file, G_FILE_MONITOR_NONE, NULL, error);