projects
/
platform
/
upstream
/
systemd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a8d4cac
)
rfkill: Avoid error when state restore is disabled
author
Bastien Nocera
<hadess@hadess.net>
Fri, 6 Dec 2013 14:51:02 +0000
(15:51 +0100)
committer
Kay Sievers
<kay@vrfy.org>
Fri, 6 Dec 2013 15:44:38 +0000
(16:44 +0100)
When the state restore is disabled, we would print:
"Unknown verb: load" instead of simply skipping loading the
state.
src/rfkill/rfkill.c
patch
|
blob
|
history
diff --git
a/src/rfkill/rfkill.c
b/src/rfkill/rfkill.c
index
65fd9bc
..
c7c6592
100644
(file)
--- 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) {