summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/rfkill/rfkill.c5
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) {