diff options
-rw-r--r-- | hwclock/Makefile.am | 2 | ||||
-rw-r--r-- | hwclock/clock.h | 2 | ||||
-rw-r--r-- | hwclock/hwclock.c | 10 |
3 files changed, 8 insertions, 6 deletions
diff --git a/hwclock/Makefile.am b/hwclock/Makefile.am index 2dd70b301..c7d95f29b 100644 --- a/hwclock/Makefile.am +++ b/hwclock/Makefile.am @@ -4,7 +4,7 @@ dist_man_MANS = hwclock.8 sbin_PROGRAMS = hwclock -hwclock_SOURCES = hwclock.c cmos.c kd.c clock.h +hwclock_SOURCES = hwclock.c cmos.c kd.c clock.h $(top_srcdir)/lib/strutils.c hwclock_LDADD = if LINUX diff --git a/hwclock/clock.h b/hwclock/clock.h index 363541bbd..175a6d1ae 100644 --- a/hwclock/clock.h +++ b/hwclock/clock.h @@ -26,7 +26,7 @@ typedef int bool; /* hwclock.c */ extern char *progname; extern int debug; -extern int epoch_option; +extern unsigned long epoch_option; extern double time_diff(struct timeval subtrahend, struct timeval subtractor); /* cmos.c */ extern void set_cmos_epoch(int ARCconsole, int SRM); diff --git a/hwclock/hwclock.c b/hwclock/hwclock.c index 2c35e857a..b8623d21e 100644 --- a/hwclock/hwclock.c +++ b/hwclock/hwclock.c @@ -74,6 +74,7 @@ #include "clock.h" #include "nls.h" #include "pathnames.h" +#include "strutils.h" #ifdef HAVE_LIBAUDIT #include <libaudit.h> @@ -143,7 +144,7 @@ bool debug; bool badyear; /* User-specified epoch, used when rtc fails to return epoch. */ -int epoch_option = -1; +unsigned long epoch_option = -1; /* * Almost all Award BIOS's made between 04/26/94 and 05/31/95 have a nasty @@ -1307,7 +1308,7 @@ manipulate_clock(const bool show, const bool adjust, const bool noadjfile, static void manipulate_epoch(const bool getepoch __attribute__ ((__unused__)), const bool setepoch __attribute__ ((__unused__)), - const int epoch_opt __attribute__ ((__unused__)), + const unsigned long epoch_opt __attribute__ ((__unused__)), const bool testing __attribute__ ((__unused__))) { warnx(_("The kernel keeps an epoch value for the Hardware Clock " @@ -1319,7 +1320,7 @@ manipulate_epoch(const bool getepoch __attribute__ ((__unused__)), static void manipulate_epoch(const bool getepoch, const bool setepoch, - const int epoch_opt, + const unsigned long epoch_opt, const bool testing) { if (getepoch) { @@ -1600,7 +1601,8 @@ int main(int argc, char **argv) date_opt = optarg; /* --date */ break; case OPT_EPOCH: - epoch_option = atoi(optarg); /* --epoch */ + epoch_option = /* --epoch */ + strtoul_or_err(optarg, _("failed to parse epoch")); break; case OPT_ADJFILE: adj_file_name = optarg; /* --adjfile */ |