aboutsummaryrefslogtreecommitdiff
path: root/toys/other/sysctl.c
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2015-09-29 05:32:57 -0500
committerRob Landley <rob@landley.net>2015-09-29 05:32:57 -0500
commit8941e5fef58025591b7441372d486cf5de46dd39 (patch)
tree478fa4729585479682ca664c639af377cd1d5af5 /toys/other/sysctl.c
parent3d9dce3b523f5e4a01189d4735c02a9b33d8c7ab (diff)
downloadtoybox-8941e5fef58025591b7441372d486cf5de46dd39.tar.gz
help_exit() tweak.
Diffstat (limited to 'toys/other/sysctl.c')
-rw-r--r--toys/other/sysctl.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/toys/other/sysctl.c b/toys/other/sysctl.c
index d4ed1b0b..a123110e 100644
--- a/toys/other/sysctl.c
+++ b/toys/other/sysctl.c
@@ -19,7 +19,7 @@ config SYSCTL
-e Don't warn about unknown keys
-N Don't print key values
-n Don't print key names
- -p [FILE] Read values from FILE (default /etc/sysctl.conf)
+ -p Read values from FILE (default /etc/sysctl.conf)
-q Don't show value after write
-w Only write values (object to reading)
*/
@@ -148,5 +148,8 @@ void sysctl_main()
fclose(fp);
// Loop through arguments, displaying or assigning as appropriate
- } else for (args = toys.optargs; *args; args++) process_key(*args, 0);
+ } else {
+ if (!*toys.optargs) help_exit(0);
+ for (args = toys.optargs; *args; args++) process_key(*args, 0);
+ }
}