[MPlayer-dev-eng] Re: [PATCH] GNU/kFreeBSD support

Rich Felker dalias at aerifal.cx
Mon Aug 22 17:00:52 CEST 2005


On Mon, Aug 22, 2005 at 03:56:38PM +0200, Robert Millan wrote:
> On Mon, Aug 22, 2005 at 12:02:03PM +0200, Dominik 'Rathann' Mierzejewski wrote:
> > On Monday, 22 August 2005 at 09:20, Robert Millan wrote:
> > > On Sun, Aug 21, 2005 at 10:12:35PM +0200, Dominik 'Rathann' Mierzejewski wrote:
> > > > > > > diff -ur MPlayer-1.0pre7.old/libmpdvdkit2/dvd_reader.c MPlayer-1.0pre7/libmpdvdkit2/dvd_reader.c
> > > > > > > --- MPlayer-1.0pre7.old/libmpdvdkit2/dvd_reader.c	2005-03-11 03:40:28.000000000 +0100
> > > > > > > +++ MPlayer-1.0pre7/libmpdvdkit2/dvd_reader.c	2005-08-05 18:44:36.000000000 +0200
> > > > > > [...]
> > > > > > > @@ -393,8 +393,8 @@
> > > > > > >  	    }
> > > > > > >  	    fclose( mntfile );
> > > > > > >  	}
> > > > > > > -#elif defined(__linux__)
> > > > > > > -        mntfile = fopen( MOUNTED, "r" );
> > > > > > > +#elif defined(__linux__) || defined(__GLIBC__)
> > > > > > > +        mntfile = fopen(_PATH_MOUNTED, "r" );
> > > > > > >          if( mntfile ) {
> > > > > > >              struct mntent *me;
> > > > > > >   
> > > > > > 
> > > > > > Why this change?
> > > > > 
> > > > > Because the code that follows (getmntent, etc) is Glibc-specific but not
> > > > > Linux-specific.  GNU/kFreeBSD can use that.
> > > > 
> > > > I meant changing MOUNTED to _PATH_MOUNTED.
> > > 
> > > According to glibc documentation, MOUNTED is a deprecated macro, only kept for
> > > backwards compatibility.
> > 
> > Deprecated in which version? I think we're still supporting libc5 systems,
> > so don't make any changes that won't work there.
> 
> Ok.  I'm attaching a new patch with all the changes you requested.

IMO the whole idea of testing based on os name is bad. It makes bad
assumptions about the particular library and header interface of each
os, which is definitely subject to change, especially since "linux"
does not imply any particular userspace.

A correct patch should remove all the #ifdef's based on os name and
instead detect the features with the configure script or (as I
recommended for this mount checking stuff) remove the "features"
entirely since they are not useful.

Rich




More information about the MPlayer-dev-eng mailing list