This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
RE: read() - problem with returned value?
- From: "Jurica Baricevic" <jura at INTESIS dot hr>
- To: "Gary Thomas" <gthomas at redhat dot com>
- Cc: "eCos Discussion" <ecos-discuss at sources dot redhat dot com>
- Date: Fri, 28 Dec 2001 18:08:12 +0100
- Subject: RE: [ECOS] read() - problem with returned value?
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.
Thanks.
Best regards,
Jura