summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Biebl <biebl@debian.org>2014-09-11 00:49:36 +0200
committerMichael Biebl <biebl@debian.org>2014-09-11 00:57:55 +0200
commit1b0413ff4fce3739c10a51ee5eeed2e7ef2e04f3 (patch)
treeb2abdc7c42693aef3f4237eda57a989c191dc148
parent4242ef948fb91a1e65e34078b25f419950fc79e8 (diff)
backlight: Avoid error when state restore is disabledv215-stable
When the state restore is disabled, we would print: "Unknown verb: load" instead of simply skipping loading the state. (cherry picked from commit b76388e123e8d73ded1fd53937d816b314948517)
-rw-r--r--src/backlight/backlight.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/backlight/backlight.c b/src/backlight/backlight.c
index 4d94ebf58..0a2bac6f1 100644
--- a/src/backlight/backlight.c
+++ b/src/backlight/backlight.c
@@ -372,9 +372,12 @@ int main(int argc, char *argv[]) {
* device probing should be complete), so that the validity
* check at boot time doesn't have to be reliable. */
- if (streq(argv[1], "load") && shall_restore_state()) {
+ if (streq(argv[1], "load")) {
_cleanup_free_ char *value = NULL;
+ if (!shall_restore_state())
+ return EXIT_SUCCESS;
+
if (!validate_device(udev, device))
return EXIT_SUCCESS;