diff options
Diffstat (limited to 'miscutils/adjtimex.c')
-rw-r--r-- | miscutils/adjtimex.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/miscutils/adjtimex.c b/miscutils/adjtimex.c index 47af1a5d2..b35538a84 100644 --- a/miscutils/adjtimex.c +++ b/miscutils/adjtimex.c | |||
@@ -12,10 +12,6 @@ | |||
12 | */ | 12 | */ |
13 | 13 | ||
14 | #include "busybox.h" | 14 | #include "busybox.h" |
15 | #include <stdio.h> | ||
16 | #include <sys/types.h> | ||
17 | #include <stdlib.h> | ||
18 | #include <unistd.h> | ||
19 | #include <sys/timex.h> | 15 | #include <sys/timex.h> |
20 | 16 | ||
21 | static const struct {int bit; const char *name;} statlist[] = { | 17 | static const struct {int bit; const char *name;} statlist[] = { |
@@ -58,19 +54,19 @@ int adjtimex_main(int argc, char **argv) | |||
58 | &opt_o, &opt_f, &opt_p, &opt_t); | 54 | &opt_o, &opt_f, &opt_p, &opt_t); |
59 | //if (opt & 0x1) // -q | 55 | //if (opt & 0x1) // -q |
60 | if (opt & 0x2) { // -o | 56 | if (opt & 0x2) { // -o |
61 | txc.offset = atoi(opt_o); | 57 | txc.offset = xatoi(opt_o); |
62 | txc.modes |= ADJ_OFFSET_SINGLESHOT; | 58 | txc.modes |= ADJ_OFFSET_SINGLESHOT; |
63 | } | 59 | } |
64 | if (opt & 0x4) { // -f | 60 | if (opt & 0x4) { // -f |
65 | txc.freq = atoi(opt_f); | 61 | txc.freq = xatou(opt_f); |
66 | txc.modes |= ADJ_FREQUENCY; | 62 | txc.modes |= ADJ_FREQUENCY; |
67 | } | 63 | } |
68 | if (opt & 0x8) { // -p | 64 | if (opt & 0x8) { // -p |
69 | txc.constant = atoi(opt_p); | 65 | txc.constant = xatoi(opt_p); |
70 | txc.modes |= ADJ_TIMECONST; | 66 | txc.modes |= ADJ_TIMECONST; |
71 | } | 67 | } |
72 | if (opt & 0x10) { // -t | 68 | if (opt & 0x10) { // -t |
73 | txc.tick = atoi(opt_t); | 69 | txc.tick = xatoi(opt_t); |
74 | txc.modes |= ADJ_TICK; | 70 | txc.modes |= ADJ_TICK; |
75 | } | 71 | } |
76 | if (argc != optind) { /* no valid non-option parameters */ | 72 | if (argc != optind) { /* no valid non-option parameters */ |