This is the mail archive of the ecos-maintainers@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]

FWD: [ECOS] Only return EWOULDBLOCK if no data moved


Hi Folks

What do people think about this patch? 

Should be apply it, or try to fix the network stack?

       Thanks
          Andrew


----- Forwarded message from Roland Ca?ebohm <roland.cassebohm@visionsystems.de> -----

From: Roland Ca?ebohm <roland.cassebohm@visionsystems.de>
To: ecos-discuss@ecos.sourceware.org
Date: Tue, 27 Jan 2004 18:03:26 +0100
Subject: [ECOS] Only return EWOULDBLOCK if no data moved
X-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00 autolearn=ham 
	version=2.63

Hello,

both TCP/IP stacks could return EWOULDBLOCK even if there are data moved
in some cases.
My first solution was the attached patch, but maybe it is better to fix
the problem in the stacks it self?

I have seen there was a semilar problem in the serial driver:

2003-03-20  Gary Thomas  <gary@mlbassoc.com>

        * src/common/serial.c: Only return -EAGAIN if no data moved.

The attached patch would fix it for all possible places where something
like this could happen.

Any suggestions?

Roland

Index: io/fileio/current/src/io.cxx
===================================================================
RCS file: /home/cassebohm/net/USERS/CVSROOT/VSprojects/ecos/packages/io/fileio/current/src/io.cxx,v
retrieving revision 1.1.1.1.2.1
diff -u -5 -p -r1.1.1.1.2.1 io.cxx
--- io/fileio/current/src/io.cxx	12 Nov 2003 10:57:18 -0000	1.1.1.1.2.1
+++ io/fileio/current/src/io.cxx	27 Jan 2004 16:50:50 -0000
@@ -144,11 +144,16 @@ readwritev( int fd, const cyg_iovec *_io
     cyg_fp_free( fp );
 
     CYG_CANCELLATION_POINT;
 
     if( ret != 0 )
-        FILEIO_RETURN(ret);
+    {
+        if ((ret == EWOULDBLOCK || ret == EAGAIN) && cnt)
+            FILEIO_RETURN_VALUE(cnt);
+        else
+            FILEIO_RETURN(ret);
+    }
  
     FILEIO_RETURN_VALUE(cnt);
 }
 
 //==========================================================================


-- 
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss

----- End forwarded message -----


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