chiark / gitweb /
do not create /dev/rtc symlink, let systemd search for it if needed
[elogind.git] / src / shared / hwclock.c
index a3b33ed4cc90dc2fad7bc594c2e65a48cf2e6d99..837f51f9478839385b60c9823ebb67374f9991de 100644 (file)
@@ -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;