From e23319dfac396d72f80a26369a34032800ad4dd55ad00ec7af8cf47f6c70d0ef Mon Sep 17 00:00:00 2001 From: "Dr. Werner Fink" Date: Tue, 25 Mar 2014 17:32:44 +0000 Subject: [PATCH] . OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd?expand=0&rev=575 --- Forward-suspend-hibernate-calls-to-pm-utils.patch | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Forward-suspend-hibernate-calls-to-pm-utils.patch b/Forward-suspend-hibernate-calls-to-pm-utils.patch index 3b50d50..0c06b4d 100644 --- a/Forward-suspend-hibernate-calls-to-pm-utils.patch +++ b/Forward-suspend-hibernate-calls-to-pm-utils.patch @@ -37,13 +37,13 @@ forward suspend/hibernation calls to pm-utils, if installed (bnc#790157) return r; } @@ -90,6 +90,8 @@ static int execute(char **modes, char ** - FILE *f; + _cleanup_fclose_ FILE *f = NULL; const char* note = strappenda("SLEEP=", arg_verb); + if (!delegate_to_pmutils) { + /* This file is opened first, so that if we hit an error, - * we can abort before modyfing any state. */ + * we can abort before modifying any state. */ f = fopen("/sys/power/state", "we"); @@ -102,6 +104,7 @@ static int execute(char **modes, char ** r = write_mode(modes); @@ -59,7 +59,7 @@ forward suspend/hibernation calls to pm-utils, if installed (bnc#790157) NULL); - + if (!delegate_to_pmutils) - r = write_state(f, states); + r = write_state(&f, states); + else + r = -system(pmtools); if (r < 0)