From: Bastien Nocera Date: Fri, 6 Dec 2013 14:51:02 +0000 (+0100) Subject: rfkill: Avoid error when state restore is disabled X-Git-Tag: v209~1102 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=commitdiff_plain;h=354806fb4632575fe2e399dd90ca607c9c127f3b;ds=sidebyside 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. --- 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) {