backlight: Avoid error when state restore is disabled

When the state restore is disabled, we would print:
"Unknown verb: load" instead of simply skipping loading the
state.
This commit is contained in:
Michael Biebl
2014-09-11 00:49:36 +02:00
parent b5338a1986
commit b76388e123
Notes: Lennart Poettering 2014-10-24 18:12:13 +02:00
Backport: bugfix

View File

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