aboutsummaryrefslogtreecommitdiff
path: root/busybox/util-linux/hwclock.c
diff options
context:
space:
mode:
Diffstat (limited to 'busybox/util-linux/hwclock.c')
-rw-r--r--busybox/util-linux/hwclock.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/busybox/util-linux/hwclock.c b/busybox/util-linux/hwclock.c
index a260d7448..3c2683953 100644
--- a/busybox/util-linux/hwclock.c
+++ b/busybox/util-linux/hwclock.c
@@ -46,7 +46,7 @@ struct linux_rtc_time {
46 int tm_yday; 46 int tm_yday;
47 int tm_isdst; 47 int tm_isdst;
48}; 48};
49 49
50#define RTC_SET_TIME _IOW('p', 0x0a, struct linux_rtc_time) /* Set RTC time */ 50#define RTC_SET_TIME _IOW('p', 0x0a, struct linux_rtc_time) /* Set RTC time */
51#define RTC_RD_TIME _IOR('p', 0x09, struct linux_rtc_time) /* Read RTC time */ 51#define RTC_RD_TIME _IOR('p', 0x09, struct linux_rtc_time) /* Read RTC time */
52 52
@@ -182,11 +182,11 @@ static int check_utc(void)
182 return utc; 182 return utc;
183} 183}
184 184
185#define HWCLOCK_OPT_LOCALTIME 1 185#define HWCLOCK_OPT_LOCALTIME 0x01
186#define HWCLOCK_OPT_UTC 2 186#define HWCLOCK_OPT_UTC 0x02
187#define HWCLOCK_OPT_SHOW 4 187#define HWCLOCK_OPT_SHOW 0x04
188#define HWCLOCK_OPT_HCTOSYS 8 188#define HWCLOCK_OPT_HCTOSYS 0x08
189#define HWCLOCK_OPT_SYSTOHC 16 189#define HWCLOCK_OPT_SYSTOHC 0x10
190 190
191extern int hwclock_main ( int argc, char **argv ) 191extern int hwclock_main ( int argc, char **argv )
192{ 192{
@@ -208,16 +208,16 @@ static const struct option hwclock_long_options[] = {
208 bb_opt_complementaly = "r~ws:w~rs:s~wr:l~u:u~l"; 208 bb_opt_complementaly = "r~ws:w~rs:s~wr:l~u:u~l";
209 opt = bb_getopt_ulflags(argc, argv, "lursw"); 209 opt = bb_getopt_ulflags(argc, argv, "lursw");
210 /* Check only one mode was given */ 210 /* Check only one mode was given */
211 if(opt & 0x80000000UL) { 211 if(opt & BB_GETOPT_ERROR) {
212 bb_show_usage(); 212 bb_show_usage();
213 } 213 }
214 214
215 /* If -u or -l wasn't given check if we are using utc */ 215 /* If -u or -l wasn't given check if we are using utc */
216 if (opt & (HWCLOCK_OPT_UTC | HWCLOCK_OPT_LOCALTIME)) 216 if (opt & (HWCLOCK_OPT_UTC | HWCLOCK_OPT_LOCALTIME))
217 utc = opt & HWCLOCK_OPT_UTC; 217 utc = opt & HWCLOCK_OPT_UTC;
218 else 218 else
219 utc = check_utc(); 219 utc = check_utc();
220 220
221 if (opt & HWCLOCK_OPT_HCTOSYS) { 221 if (opt & HWCLOCK_OPT_HCTOSYS) {
222 return to_sys_clock ( utc ); 222 return to_sys_clock ( utc );
223 } 223 }