mirror of
https://gitlab.freedesktop.org/upower/upower.git
synced 2026-05-05 09:58:06 +02:00
Fix linux up_backend_supports_sleep_state() return code.
Under Linux, regardless of the exit code of /usr/bin/pm-is-supported, it will always set CanSuspend and CanHibernate to true due to a logic error in up_backend_supports_sleep_state in src/linux/up-backend.c: The 'ret' variable is re-used for the return code without being re-initialized to false after the call to g_spawn_command_line_sync. Signed-off-by: Martin Pitt <martin.pitt@ubuntu.com>
This commit is contained in:
parent
626c087b48
commit
ff23a9c6e2
1 changed files with 2 additions and 2 deletions
|
|
@ -361,8 +361,8 @@ up_backend_supports_sleep_state (const gchar *state)
|
|||
g_error_free (error);
|
||||
goto out;
|
||||
}
|
||||
if (WIFEXITED(exit_status) && (WEXITSTATUS(exit_status) == EXIT_SUCCESS))
|
||||
ret = TRUE;
|
||||
ret = (WIFEXITED(exit_status) && (WEXITSTATUS(exit_status) == EXIT_SUCCESS));
|
||||
|
||||
out:
|
||||
g_free (command);
|
||||
return ret;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue