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;
}
@@ -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)