|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
From b76388e123e8d73ded1fd53937d816b314948517 Mon Sep 17 00:00:00 2001
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
From: Michael Biebl <biebl@debian.org>
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
Date: Thu, 11 Sep 2014 00:49:36 +0200
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
Subject: [PATCH] backlight: Avoid error when state restore is disabled
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
When the state restore is disabled, we would print:
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
"Unknown verb: load" instead of simply skipping loading the
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
state.
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
---
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
src/backlight/backlight.c | 5 ++++-
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
1 file changed, 4 insertions(+), 1 deletion(-)
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
diff --git a/src/backlight/backlight.c b/src/backlight/backlight.c
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
index 4d94ebf58a..0a2bac6f16 100644
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
--- a/src/backlight/backlight.c
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+++ b/src/backlight/backlight.c
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
@@ -372,9 +372,12 @@ int main(int argc, char *argv[]) {
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
* device probing should be complete), so that the validity
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
* check at boot time doesn't have to be reliable. */
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
- if (streq(argv[1], "load") && shall_restore_state()) {
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+ if (streq(argv[1], "load")) {
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
_cleanup_free_ char *value = NULL;
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+ if (!shall_restore_state())
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+ return EXIT_SUCCESS;
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
if (!validate_device(udev, device))
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
return EXIT_SUCCESS;
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
|