main: Return D-Bus error on profile activation failure

Throw a D-Bus error when activating a profile fails:
gi.repository.GLib.GError: g-io-error-quark: GDBus.Error:org.gtk.GDBus.UnmappedGError.Quark._g_2dio_2derror_2dquark.Code26: Error writing '/sys/devices/system/cpu/cpufreq/policy1/energy_performance_preference': Device or resource busy (26)

Closes: #90
This commit is contained in:
Bastien Nocera 2022-04-27 16:57:04 +02:00
parent d000f9a3ff
commit 6719ced657

View file

@ -399,7 +399,8 @@ set_active_profile (PpdApp *data,
mask |= PROP_ACTIVE_PROFILE_HOLDS;
}
activate_target_profile (data, target_profile, PPD_PROFILE_ACTIVATION_REASON_USER, NULL);
if (!activate_target_profile (data, target_profile, PPD_PROFILE_ACTIVATION_REASON_USER, error))
return FALSE;
data->selected_profile = target_profile;
send_dbus_event (data, mask);