summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKay Sievers <kay@vrfy.org>2013-04-24 19:12:44 +0200
committerKay Sievers <kay@vrfy.org>2013-04-24 19:20:51 +0200
commit2b3c81b02fa5dd47b19558c7684e113f36a48486 (patch)
treef4e9213422c15508b540275d6002d03691982842 /src
parent83cb95b530ca5ae17bd9249774940840a4bbb667 (diff)
do not create /dev/rtc symlink, let systemd search for it if needed
The export of the RTCs hctosys flag is uneccesary, the kernel takes care of the persistemt clock management itself, without any need for: CONFIG_RTC_HCTOSYS=y CONFIG_RTC_HCTOSYS_DEVICE="rtc0" "Chaotic hardware platforms" without native kernel persistent clock support will find the proper RTC with the logic rtc_open() without the need for a custom symlink.
Diffstat (limited to 'src')
-rw-r--r--src/shared/hwclock.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/src/shared/hwclock.c b/src/shared/hwclock.c
index a3b33ed4cc..837f51f947 100644
--- a/src/shared/hwclock.c
+++ b/src/shared/hwclock.c
@@ -47,15 +47,14 @@ static int rtc_open(int flags) {
int fd;
DIR *d;
- /* First, we try to make use of the /dev/rtc symlink. If that
- * doesn't exist, we open the first RTC which has hctosys=1
- * set. If we don't find any we just take the first RTC that
- * exists at all. */
-
- fd = open("/dev/rtc", flags);
- if (fd >= 0)
- return fd;
-
+ /*
+ * Some "chaotic platforms" have multiple RTCs and we need to
+ * find the "system RTC", which is in some setups /dev/rtc1.
+ *
+ * First, we try to find the RTC which has hctosys=1 set. If we
+ * don't find any we just take the first RTC that exists at all,
+ * then try to open /dev/rtc0.
+ */
d = opendir("/sys/class/rtc");
if (!d)
goto fallback;