[MPlayer-dev-eng] Re: [PATCH] Trivial, Linux DevFS/RTC compatibility

Robert Cardell rbt at mtlb.co.uk
Sun Sep 29 23:24:41 CEST 2002


(BTW, I wasn't subscribed before and I wasn't CC:'ed, which is why I can't
continue the thread properly. I'm subscribed now, no need to cc.)

Sidik,

I checked for them in that order for two reasons:

a. /dev/rtc could be a symlink to some other RTC device. For example, on IA-64
there's one called /dev/efirtc. Perhaps the RTC device node should actually be
a configurable option.

b. It's the order in which hwclock checks for them.

So how about the following? It checks in the same order, but follows the
hwclock behaviour in that it only tries /dev/misc/rtc if /dev/rtc doesn't
exist. (NB: I've just edited the previous patch here, this one's untested.)

Rob
<rbt at mtlb.co.uk>

--- MPlayer-0.90pre8/mplayer.c	2002-09-16 17:53:25.000000000 +0100
+++ MPlayer-0.90pre8-devfs/mplayer.c	2002-09-24 16:03:04.000000000 +0100
@@ -701,8 +701,12 @@
 #ifdef HAVE_RTC
   if(!nortc)
   {
-    if ((rtc_fd = open("/dev/rtc", O_RDONLY)) < 0)
-	mp_msg(MSGT_CPLAYER, MSGL_ERR, "Linux RTC init error: %s\n", strerror(errno));
+    rtc_fd = open("/dev/rtc", O_RDONLY);
+    if (rtc_fd < 0 && errno == ENOENT)
+        rtc_fd = open("/dev/misc/rtc", O_RDONLY);
+
+    if (rtc_fd < 0)
+        mp_msg(MSGT_CPLAYER, MSGL_ERR, "Linux RTC init error: %s\n", strerror(errno));
     else {
 	unsigned long irqp;
 



More information about the MPlayer-dev-eng mailing list