chiark / gitweb /
rfkill: Avoid error when state restore is disabled
[elogind.git] / src / rfkill / rfkill.c
index 65fd9bc478729486b96a38761850441accce15ee..c7c659292abefb0fb0ece120bbf70878fe4dd47d 100644 (file)
@@ -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) {