This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: read() - problem with returned value?


On Fri, 2001-12-28 at 10:08, Jurica Baricevic wrote:
> Gary Thomas wrote (Friday, December 28, 2001 17:17):
> >
> > It looks like there is a missing "check for error" in the readwrite
> > path.  Can you try this patch and see if it fixes it?  Let us know and
> > if it fixes your problem, we'll commit it.
> >
> > Index: io/fileio/current/src/io.cxx
> > ===================================================================
> > RCS file: /home/cvs/ecc/ecc/io/fileio/current/src/io.cxx,v
> > retrieving revision 1.5
> > diff -u -5 -p -r1.5 io.cxx
> > --- io/fileio/current/src/io.cxx	1 Nov 2000 16:30:53 -0000	1.5
> > +++ io/fileio/current/src/io.cxx	28 Dec 2001 16:15:17 -0000
> > @@ -117,10 +117,13 @@ static ssize_t readwrite( int fd, void *
> >      LOCK_FILE( fp );
> >
> >      ret = op( fp, &uio );
> >
> >      UNLOCK_FILE( fp );
> > +
> > +    if( ret != 0 )
> > +        FILEIO_RETURN(ret);
> >
> >      cnt -= uio.uio_resid;
> >
> >      cyg_fp_free( fp );
> >
> >
> 
> I can confirm that your patch solved my problem. Also, it seems safe (it
> should not break anything). I hope that you will commit the patch as soon as
> possible.

Done :-)



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]