diff options
author | Bastien Nocera <hadess@hadess.net> | 2013-12-06 15:51:02 +0100 |
---|---|---|
committer | Kay Sievers <kay@vrfy.org> | 2013-12-06 16:44:38 +0100 |
commit | 354806fb4632575fe2e399dd90ca607c9c127f3b (patch) | |
tree | 2b39590327fedad27480e2cef7729df61b4f41c9 /src/rfkill/rfkill.c | |
parent | a8d4cac55cf9575d19ff5a1747e726387f5a552f (diff) |
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.
Diffstat (limited to 'src/rfkill/rfkill.c')
-rw-r--r-- | src/rfkill/rfkill.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/rfkill/rfkill.c b/src/rfkill/rfkill.c index 65fd9bc478..c7c659292a 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) { |