This is the mail archive of the ecos-discuss@sourceware.org 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: Question on disk_bwrite and disk_bread


Looking the code of disk_bread() and disk_bwrite() I see one difference
in a similar test:
In disk_bread()
            if (pos > last)
            {
                res = -EIO;
                break;
            }
In disk_bwrite()
            if (pos > last)
            {
                res = -EIO;
                goto done;
            }

The break leaves the while loop and then ctlr->busy = false;
It is what I want when the (funs->read) or (funs->write) return en
error.
So in disk_bread() & disk_bwrite() I replaced all the "goto done;" by
"break;"
So now the thread is not blocked and I am able to launch again a read or
write operation.

@@ -561,12 +561,12 @@
             cyg_drv_dsr_unlock();
             
             if (ENOERR != res)
-                goto done;
+                break;
 
             if (!info->connected)
             {
                 res = -EINVAL;
-                goto done;
+                break;
             }
 
             bbuf        += tfr * info->block_size;
@@ -637,7 +637,7 @@
             if (pos > last)
             {
                 res = -EIO;
-                goto done;
+                break;
             }
 
             if( tfr > info->ident.max_transfer )
@@ -665,12 +665,12 @@
             cyg_drv_dsr_unlock();
             
             if (ENOERR != res)
-                goto done;
+                break;
  
             if (!info->connected)
             {
                 res = -EINVAL;
-                goto done;
+                break;
             }
 
             bbuf        += tfr * info->block_size;

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


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