mirror of
https://gitlab.freedesktop.org/upower/power-profiles-daemon.git
synced 2026-05-08 10:08:01 +02:00
platform-profile: Fix crash if kernel built w/o platform_profile
If the kernel is built with platform_profile support, g_file_get_contents() will fail, and we'll likely crash trying to access ->message in the struct. Don't forget to pass the error to g_file_get_contents().
This commit is contained in:
parent
24755fec0a
commit
3b0f72989b
1 changed files with 1 additions and 1 deletions
|
|
@ -101,7 +101,7 @@ read_platform_profile (void)
|
|||
|
||||
platform_profile_path = ppd_utils_get_sysfs_path (ACPI_PLATFORM_PROFILE_PATH);
|
||||
if (!g_file_get_contents (platform_profile_path,
|
||||
&new_profile_str, NULL, NULL)) {
|
||||
&new_profile_str, NULL, &error)) {
|
||||
g_debug ("Failed to get contents for '%s': %s",
|
||||
platform_profile_path,
|
||||
error->message);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue