summaryrefslogtreecommitdiffstats
path: root/hwclock/hwclock.c
diff options
context:
space:
mode:
authorKarel Zak2007-03-19 10:14:13 +0100
committerKarel Zak2007-03-19 10:14:13 +0100
commit88681c5f1afe724ca914a7202225e6e640d37222 (patch)
tree491491a942c1b0c1942397a43cd258382eabc645 /hwclock/hwclock.c
parentdocs: fix URL and typos in README.devel (diff)
downloadkernel-qcow2-util-linux-88681c5f1afe724ca914a7202225e6e640d37222.tar.gz
kernel-qcow2-util-linux-88681c5f1afe724ca914a7202225e6e640d37222.tar.xz
kernel-qcow2-util-linux-88681c5f1afe724ca914a7202225e6e640d37222.zip
hwclock: add --rtc=<path> 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 <david-b@pacbell.net> Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'hwclock/hwclock.c')
-rw-r--r--hwclock/hwclock.c7
1 files changed, 6 insertions, 1 deletions
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();