]> oss.titaniummirror.com Git - tinyos-2.x.git/commitdiff
Shouldn't fail when you reach the end of the log. Sync instead.
authorscipio <scipio>
Wed, 10 Feb 2010 19:13:06 +0000 (19:13 +0000)
committerscipio <scipio>
Wed, 10 Feb 2010 19:13:06 +0000 (19:13 +0000)
apps/tests/storage/Log/RandRWC.nc

index 0c7ee628a86165df2ccb0c2f7a4ace69e4403d49..7a79e132a96bf34803c8129c402826a85e630814 100644 (file)
@@ -138,8 +138,16 @@ implementation {
       scheck(call LogWrite.sync());
     else
       {
+       error_t result;
        setParameters();
-       scheck(call LogWrite.append(data + offset, len));
+       result = call LogWrite.append(data + offset, len);
+       if (result == ESIZE) {
+         // We have reached the end of the log, sync it
+         scheck(call LogWrite.sync());
+       }
+       else {
+         scheck(result);
+       }
       }
   }