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

Fix mqueue loop busy check


Index: ChangeLog
===================================================================
RCS file: /cvs/ecos/ecos/packages/kernel/current/ChangeLog,v
retrieving revision 1.99
diff -u -5 -p -r1.99 ChangeLog
--- ChangeLog	3 Mar 2003 05:15:52 -0000	1.99
+++ ChangeLog	3 May 2003 14:21:55 -0000
@@ -1,5 +1,11 @@
+2003-05-03  Jonathan Larmour  <jifl@eCosCentric.com>
+
+	* include/mqueue.inl (Cyg_Mqueue::get): Fix invalid loop termination
+	cheque for whether busy or not.
+	(Cyg_Mqueue::put): Ditto.
+
 2003-03-03  Jonathan Larmour  <jifl@eCosCentric.com>
 
 	* tests/fptest.c: Make all variables static to avoid any risk
 	of collisions with symbols defined elsewhere in eCos.
 
Index: include/mqueue.inl
===================================================================
RCS file: /cvs/ecos/ecos/packages/kernel/current/include/mqueue.inl,v
retrieving revision 1.6
diff -u -5 -p -r1.6 mqueue.inl
--- include/mqueue.inl	13 Jan 2003 05:50:24 -0000	1.6
+++ include/mqueue.inl	3 May 2003 14:21:55 -0000
@@ -322,11 +322,11 @@ Cyg_Mqueue::put( const char *buf, size_t
 
     if (!freelist->busy) { // fast-track common case
         qent     = freelist;
         freelist = freelist->next;
     } else {
-        for ( qtmp=freelist; !qtmp->next->busy; qtmp=qtmp->next )
+        for ( qtmp=freelist; qtmp->next->busy; qtmp=qtmp->next )
             CYG_EMPTY_STATEMENT; // skip through
         qent       = qtmp->next;
         qtmp->next = qent->next;
     }
             
@@ -444,11 +444,11 @@ Cyg_Mqueue::get( char *buf, size_t *len,
         qent       = q;
         q          = qent->next;
     } else {
         struct qentry *qtmp;
 
-        for ( qtmp=q; !qtmp->next->busy; qtmp=qtmp->next )
+        for ( qtmp=q; qtmp->next->busy; qtmp=qtmp->next )
             CYG_EMPTY_STATEMENT; // skip through
 
         qent = qtmp->next;
         qtmp->next = qent->next;
     } // else


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