Dr. Werner Fink 2014-03-25 17:32:44 +00:00 committed by Git OBS Bridge
parent 173b23b934
commit e23319dfac

View File

@ -37,13 +37,13 @@ forward suspend/hibernation calls to pm-utils, if installed (bnc#790157)
return r; return r;
} }
@@ -90,6 +90,8 @@ static int execute(char **modes, char ** @@ -90,6 +90,8 @@ static int execute(char **modes, char **
FILE *f; _cleanup_fclose_ FILE *f = NULL;
const char* note = strappenda("SLEEP=", arg_verb); const char* note = strappenda("SLEEP=", arg_verb);
+ if (!delegate_to_pmutils) { + if (!delegate_to_pmutils) {
+ +
/* This file is opened first, so that if we hit an error, /* 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"); f = fopen("/sys/power/state", "we");
@@ -102,6 +104,7 @@ static int execute(char **modes, char ** @@ -102,6 +104,7 @@ static int execute(char **modes, char **
r = write_mode(modes); r = write_mode(modes);
@ -59,7 +59,7 @@ forward suspend/hibernation calls to pm-utils, if installed (bnc#790157)
NULL); NULL);
- -
+ if (!delegate_to_pmutils) + if (!delegate_to_pmutils)
r = write_state(f, states); r = write_state(&f, states);
+ else + else
+ r = -system(pmtools); + r = -system(pmtools);
if (r < 0) if (r < 0)