From 354806fb4632575fe2e399dd90ca607c9c127f3b Mon Sep 17 00:00:00 2001 From: Bastien Nocera Date: Fri, 6 Dec 2013 15:51:02 +0100 Subject: [PATCH] rfkill: 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. --- src/rfkill/rfkill.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/rfkill/rfkill.c b/src/rfkill/rfkill.c index 65fd9bc47..c7c659292 100644 --- a/src/rfkill/rfkill.c +++ b/src/rfkill/rfkill.c @@ -95,9 +95,12 @@ int main(int argc, char *argv[]) { return EXIT_FAILURE; } - 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; + r = read_one_line_file(saved, &value); if (r < 0) { -- 2.30.2