From 88681c5f1afe724ca914a7202225e6e640d37222 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Mon, 19 Mar 2007 10:14:13 +0100 Subject: hwclock: add --rtc= option and support for /dev/rtc0 The patch to allow "hwclock --rtc /dev/rtc1" and so on, since "/dev/rtc" may not be there and "/dev/rtc0" may not be the right answer either. The "--rtc" is compatible with next Bryan Henderson's hwclock versions. Signed-off-by: David Brownell Signed-off-by: Karel Zak --- hwclock/hwclock.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'hwclock/hwclock.c') diff --git a/hwclock/hwclock.c b/hwclock/hwclock.c index ec8681527..9731dadfb 100644 --- a/hwclock/hwclock.c +++ b/hwclock/hwclock.c @@ -1210,6 +1210,7 @@ usage( const char *fmt, ... ) { "\nOptions: \n" " --utc the hardware clock is kept in coordinated universal time\n" " --localtime the hardware clock is kept in local time\n" + " --rtc=path special /dev/... file to use instead of default\n" " --directisa access the ISA bus directly instead of %s\n" " --badyear ignore rtc's year because the bios is broken\n" " --date specifies the time to which to set the hardware clock\n" @@ -1265,6 +1266,7 @@ static const struct option longopts[] = { { "test", 0, 0, 135 }, { "date", 1, 0, 136 }, { "epoch", 1, 0, 137 }, + { "rtc", 1, 0, 'f' }, { NULL, 0, 0, 0 } }; @@ -1314,7 +1316,7 @@ main(int argc, char **argv) { ARCconsole = Jensen = SRM = funky_toy = directisa = badyear = FALSE; date_opt = NULL; - while ((c = getopt_long (argc, argv, "?hvVDarsuwAJSF", longopts, NULL)) + while ((c = getopt_long (argc, argv, "?hvVDarsuwAJSFf:", longopts, NULL)) != -1) { switch (c) { case 'D': @@ -1379,6 +1381,9 @@ main(int argc, char **argv) { case 137: epoch_option = atoi(optarg); /* --epoch */ break; + case 'f': + rtc_dev_name = optarg; /* --rtc */ + break; case 'v': /* --version */ case 'V': out_version(); -- cgit v1.2.3-55-g7522