diff options
author | Karel Zak | 2006-12-07 00:26:08 +0100 |
---|---|---|
committer | Karel Zak | 2006-12-07 00:26:08 +0100 |
commit | a5a16c68537f8c3e5e61c5fb1680ee9f82b70a4d (patch) | |
tree | 830565491cb6af2b456960d28c093054fa287e0b /hwclock | |
parent | Imported from util-linux-2.11x tarball. (diff) | |
download | kernel-qcow2-util-linux-a5a16c68537f8c3e5e61c5fb1680ee9f82b70a4d.tar.gz kernel-qcow2-util-linux-a5a16c68537f8c3e5e61c5fb1680ee9f82b70a4d.tar.xz kernel-qcow2-util-linux-a5a16c68537f8c3e5e61c5fb1680ee9f82b70a4d.zip |
Imported from util-linux-2.11y tarball.
Diffstat (limited to 'hwclock')
-rw-r--r-- | hwclock/rtc.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/hwclock/rtc.c b/hwclock/rtc.c index 98d1ef9c4..b13a46a87 100644 --- a/hwclock/rtc.c +++ b/hwclock/rtc.c @@ -89,20 +89,19 @@ struct linux_rtc_time { #define RTC_DEVN "rtc" #endif -static char rtc_dev_name[40]; +static char *rtc_dev_name; -/* maybe we should not try /dev/misc/efirtc? */ static int open_rtc(void) { int rtc_fd; - sprintf(rtc_dev_name, "/dev/%s", RTC_DEVN); + rtc_dev_name = "/dev/" RTC_DEVN; rtc_fd = open(rtc_dev_name, O_RDONLY); if (rtc_fd < 0 && errno == ENOENT) { - sprintf(rtc_dev_name, "/dev/misc/%s", RTC_DEVN); + rtc_dev_name = "/dev/misc/" RTC_DEVN; rtc_fd = open(rtc_dev_name, O_RDONLY); if (rtc_fd < 0 && errno == ENOENT) - sprintf(rtc_dev_name, "/dev/%s", RTC_DEVN); + rtc_dev_name = "/dev/" RTC_DEVN; } return rtc_fd; } |