]> oss.titaniummirror.com Git - tinyos-2.x.git/blobdiff - apps/tests/storage/Log/RandRWC.nc
handle full log
[tinyos-2.x.git] / apps / tests / storage / Log / RandRWC.nc
index ab762de78271413ce077fd68c188132b22340187..7e5ae49ae099b3f4106a9c26c54e8d8be8c9fd13 100644 (file)
@@ -99,6 +99,8 @@ implementation {
     return b;
   }
 
+  volatile int x;
+
   void setParameters() {
     len = rand() >> 8;
     offset = rand() >> 9;
@@ -138,7 +140,9 @@ implementation {
   }
 
   event void LogWrite.appendDone(void *buf, storage_len_t y, bool recordsLost, error_t result) {
-    if (scheck(result))
+    if (result == ESIZE)
+      scheck(call LogWrite.sync());
+    else if (scheck(result))
       nextWrite();
   }