diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2014-04-17 11:29:34 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2014-04-17 11:29:34 +0200 |
commit | e152cb818903f219a641c03b7c3ef290ed39a49d (patch) | |
tree | 579609067a5cf27be22980b6df4ee5dc34349b6f /miscutils | |
parent | eb9f485b07b1823efbfddc773c899bd35dee62a6 (diff) | |
download | busybox-w32-e152cb818903f219a641c03b7c3ef290ed39a49d.tar.gz busybox-w32-e152cb818903f219a641c03b7c3ef290ed39a49d.tar.bz2 busybox-w32-e152cb818903f219a641c03b7c3ef290ed39a49d.zip |
adjtimex: make its help text and printed data a bit less cryptic
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'miscutils')
-rw-r--r-- | miscutils/adjtimex.c | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/miscutils/adjtimex.c b/miscutils/adjtimex.c index c8816e9e7..534364a69 100644 --- a/miscutils/adjtimex.c +++ b/miscutils/adjtimex.c | |||
@@ -14,12 +14,12 @@ | |||
14 | //usage:#define adjtimex_trivial_usage | 14 | //usage:#define adjtimex_trivial_usage |
15 | //usage: "[-q] [-o OFF] [-f FREQ] [-p TCONST] [-t TICK]" | 15 | //usage: "[-q] [-o OFF] [-f FREQ] [-p TCONST] [-t TICK]" |
16 | //usage:#define adjtimex_full_usage "\n\n" | 16 | //usage:#define adjtimex_full_usage "\n\n" |
17 | //usage: "Read and optionally set system timebase parameters. See adjtimex(2)\n" | 17 | //usage: "Read or set kernel time variables. See adjtimex(2)\n" |
18 | //usage: "\n -q Quiet" | 18 | //usage: "\n -q Quiet" |
19 | //usage: "\n -o OFF Time offset, microseconds" | 19 | //usage: "\n -o OFF Time offset, microseconds" |
20 | //usage: "\n -f FREQ Frequency adjust, integer kernel units (65536 is 1ppm)" | 20 | //usage: "\n -f FREQ Frequency adjust, integer kernel units (65536 is 1ppm)" |
21 | //usage: "\n (positive values make clock run faster)" | ||
22 | //usage: "\n -t TICK Microseconds per tick, usually 10000" | 21 | //usage: "\n -t TICK Microseconds per tick, usually 10000" |
22 | //usage: "\n (positive -t or -f values make clock run faster)" | ||
23 | //usage: "\n -p TCONST" | 23 | //usage: "\n -p TCONST" |
24 | 24 | ||
25 | #include "libbb.h" | 25 | #include "libbb.h" |
@@ -111,13 +111,13 @@ int adjtimex_main(int argc UNUSED_PARAM, char **argv) | |||
111 | } | 111 | } |
112 | 112 | ||
113 | if (!(opt & OPT_quiet)) { | 113 | if (!(opt & OPT_quiet)) { |
114 | int sep; | 114 | const char *sep; |
115 | const char *name; | 115 | const char *name; |
116 | 116 | ||
117 | printf( | 117 | printf( |
118 | " mode: %d\n" | 118 | " mode: %d\n" |
119 | "-o offset: %ld\n" | 119 | "-o offset: %ld us\n" |
120 | "-f frequency: %ld\n" | 120 | "-f freq.adjust: %ld (65536 = 1ppm)\n" |
121 | " maxerror: %ld\n" | 121 | " maxerror: %ld\n" |
122 | " esterror: %ld\n" | 122 | " esterror: %ld\n" |
123 | " status: %d (", | 123 | " status: %d (", |
@@ -125,15 +125,14 @@ int adjtimex_main(int argc UNUSED_PARAM, char **argv) | |||
125 | txc.esterror, txc.status); | 125 | txc.esterror, txc.status); |
126 | 126 | ||
127 | /* representative output of next code fragment: | 127 | /* representative output of next code fragment: |
128 | "PLL | PPSTIME" */ | 128 | * "PLL | PPSTIME" |
129 | */ | ||
129 | name = statlist_name; | 130 | name = statlist_name; |
130 | sep = 0; | 131 | sep = ""; |
131 | for (i = 0; statlist_bit[i]; i++) { | 132 | for (i = 0; statlist_bit[i]; i++) { |
132 | if (txc.status & statlist_bit[i]) { | 133 | if (txc.status & statlist_bit[i]) { |
133 | if (sep) | 134 | printf("%s%s", sep, name); |
134 | fputs(" | ", stdout); | 135 | sep = " | "; |
135 | fputs(name, stdout); | ||
136 | sep = 1; | ||
137 | } | 136 | } |
138 | name += strlen(name) + 1; | 137 | name += strlen(name) + 1; |
139 | } | 138 | } |
@@ -143,9 +142,9 @@ int adjtimex_main(int argc UNUSED_PARAM, char **argv) | |||
143 | descript = nth_string(ret_code_descript, ret); | 142 | descript = nth_string(ret_code_descript, ret); |
144 | printf(")\n" | 143 | printf(")\n" |
145 | "-p timeconstant: %ld\n" | 144 | "-p timeconstant: %ld\n" |
146 | " precision: %ld\n" | 145 | " precision: %ld us\n" |
147 | " tolerance: %ld\n" | 146 | " tolerance: %ld\n" |
148 | "-t tick: %ld\n" | 147 | "-t tick: %ld us\n" |
149 | " time.tv_sec: %ld\n" | 148 | " time.tv_sec: %ld\n" |
150 | " time.tv_usec: %ld\n" | 149 | " time.tv_usec: %ld\n" |
151 | " return value: %d (%s)\n", | 150 | " return value: %d (%s)\n", |