freetype-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Devel] fall-back for mmap


From: Masatake YAMATO
Subject: Re: [Devel] fall-back for mmap
Date: Sat, 14 Feb 2004 21:09:53 +0900 (JST)

The patch I posted here is not reviewed by FreeType developers.
Is it not worth to introduce the patch?

Masatake YAMATO

> Hi,
> 
> > Masatake YAMATO <address@hidden> wrote:
> > 
> > +      if ( stream->size != read ( file, stream->base, stream->size ) )
> > +      {
> > +            FT_ERROR(( "FT_Stream_Open:" ));
> > +            FT_ERROR(( " could not `read' file `%s'\n", filepathname ));
> > +            goto Fail_Read;
> > +      }
> > 
> > Please don't do this!  This is not guaranteed to work - read()
> > may legally read less bytes than requested.  Perhaps it was
> > interrupted by a signal, or perhaps it's just a wierd (but legal)
> > filesystem driver.  The only safe way to call read() is in a loop.
> > If you read less than you requested, or if read() returns -1 and
> > sets errno to EINTR, then try again to read the rest of the file.
> 
> Thank you for your suggestion.
> A loop around read() is added.
> 
> Masatake YAMATO



reply via email to

[Prev in Thread] Current Thread [Next in Thread]