[MPlayer-dev-eng] [PATCH] Trivial, Linux DevFS/RTC compatibilty

Sidik Isani lksi at cfht.hawaii.edu
Sun Sep 29 22:33:36 CEST 2002


On Sun, Sep 29, 2002 at 07:10:35PM +0100, Robert Cardell wrote:
> 
> Hi all,
> 
> The patch below causes MPlayer to look for the RTC device at /dev/misc/rtc
> (the default devfs location) as well as /dev/rtc. Patch is against 0.90-pre8.
> I'm not on the list, cc me to reply. (Or forcibly subscribe me :)
> 
> 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 )
> +        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));

Hello -

  Maybe at least switch the order (try "/dev/misc/rtc" _first_).
  Otherwise, someone on a non-devfs system with a "Permission denied"
  problem on /dev/rtc will start seeing "No such file or directory"
  instead, which is confusing.

Be seeing you,

- Sidik



More information about the MPlayer-dev-eng mailing list