[systemd-commits] src/rfkill
Kay Sievers
kay at kemper.freedesktop.org
Fri Dec 6 07:45:05 PST 2013
src/rfkill/rfkill.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
New commits:
commit 354806fb4632575fe2e399dd90ca607c9c127f3b
Author: Bastien Nocera <hadess at hadess.net>
Date: Fri Dec 6 15:51:02 2013 +0100
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 65fd9bc..c7c6592 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) {
More information about the systemd-commits
mailing list