56 |
; |
; |
57 |
|
|
58 |
int adjtimex_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; |
int adjtimex_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; |
59 |
int adjtimex_main(int argc, char **argv) |
int adjtimex_main(int argc UNUSED_PARAM, char **argv) |
60 |
{ |
{ |
61 |
enum { |
enum { |
62 |
OPT_quiet = 0x1 |
OPT_quiet = 0x1 |
66 |
struct timex txc; |
struct timex txc; |
67 |
int i, ret; |
int i, ret; |
68 |
const char *descript; |
const char *descript; |
|
txc.modes=0; |
|
69 |
|
|
70 |
|
opt_complementary = "=0"; /* no valid non-option parameters */ |
71 |
opt = getopt32(argv, "qo:f:p:t:", |
opt = getopt32(argv, "qo:f:p:t:", |
72 |
&opt_o, &opt_f, &opt_p, &opt_t); |
&opt_o, &opt_f, &opt_p, &opt_t); |
73 |
|
txc.modes = 0; |
74 |
//if (opt & 0x1) // -q |
//if (opt & 0x1) // -q |
75 |
if (opt & 0x2) { // -o |
if (opt & 0x2) { // -o |
76 |
txc.offset = xatol(opt_o); |
txc.offset = xatol(opt_o); |
88 |
txc.tick = xatol(opt_t); |
txc.tick = xatol(opt_t); |
89 |
txc.modes |= ADJ_TICK; |
txc.modes |= ADJ_TICK; |
90 |
} |
} |
|
if (argc != optind) { /* no valid non-option parameters */ |
|
|
bb_show_usage(); |
|
|
} |
|
91 |
|
|
92 |
ret = adjtimex(&txc); |
ret = adjtimex(&txc); |
93 |
|
|