[MPlayer-cvslog] r24194 - trunk/osdep/mmap_anon.c

Diego Biurrun diego at biurrun.de
Sat Aug 25 19:40:34 CEST 2007


On Sat, Aug 25, 2007 at 07:25:14PM +0200, Reimar Döffinger wrote:
> On Sat, Aug 25, 2007 at 07:09:09PM +0200, diego wrote:
> > 
> > Log:
> > warning fix:
> > mmap_anon.c: In function 'mmap_anon':
> > mmap_anon.c:37: warning: unused variable 'fd'
> > 
> > --- trunk/osdep/mmap_anon.c	(original)
> > +++ trunk/osdep/mmap_anon.c	Sat Aug 25 19:09:09 2007
> > @@ -34,7 +34,6 @@
> >   */
> >  void *mmap_anon(void *addr, size_t len, int prot, int flags, off_t offset)
> >  {
> > -    int fd;
> >      void *result;
> >  
> >       /* From loader/ext.c:
> > @@ -50,6 +49,7 @@ void *mmap_anon(void *addr, size_t len, 
> >      result = mmap(addr, len, prot, flags | MAP_ANONYMOUS, -1, offset);
> >  #else
> >      /* SysV-style anonymous mapping */
> > +    int fd;
> >      fd = open("/dev/zero", O_RDWR);
> >      if(fd < 0){
> >          perror( "Cannot open /dev/zero for READ+WRITE. Check permissions! error: ");
> 
> Well, it was there to avoid problems with gcc 2.95.
> No idea what kind of systems still do not have MAP_ANONYMOUS though.

I explicitly tested this with gcc 2.95, the preprocessor removes all
statements before this variable declaration.

Diego



More information about the MPlayer-cvslog mailing list