aboutsummaryrefslogtreecommitdiff
path: root/libbb
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2008-02-15 07:19:03 +0000
committerMike Frysinger <vapier@gentoo.org>2008-02-15 07:19:03 +0000
commit977bc6a1374ed468ec96e2202757be0c8b3592ed (patch)
tree00cd5d36831b37f1b941f38f87884d80f7e04409 /libbb
parentea915363e747d4e42215016ceaef4b19e01baf55 (diff)
downloadbusybox-977bc6a1374ed468ec96e2202757be0c8b3592ed.tar.gz
we need to pass back the rtc device name that was actually used so that we can turn around and check its sysfs status
Diffstat (limited to 'libbb')
-rw-r--r--libbb/rtc.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/libbb/rtc.c b/libbb/rtc.c
index 4cbf32206..78f10c65d 100644
--- a/libbb/rtc.c
+++ b/libbb/rtc.c
@@ -40,21 +40,23 @@ int rtc_adjtime_is_utc(void)
return utc;
}
-int rtc_xopen(const char *default_rtc, int flags)
+int rtc_xopen(const char **default_rtc, int flags)
{
int rtc;
- if (!default_rtc) {
- rtc = open("/dev/rtc", flags);
+ if (!*default_rtc) {
+ *default_rtc = "/dev/rtc";
+ rtc = open(*default_rtc, flags);
if (rtc >= 0)
return rtc;
- rtc = open("/dev/rtc0", flags);
+ *default_rtc = "/dev/rtc0";
+ rtc = open(*default_rtc, flags);
if (rtc >= 0)
return rtc;
- default_rtc = "/dev/misc/rtc";
+ *default_rtc = "/dev/misc/rtc";
}
- return xopen(default_rtc, flags);
+ return xopen(*default_rtc, flags);
}
time_t rtc_read_time(int fd, int utc)