]> oss.titaniummirror.com Git - tinyos-2.x.git/blobdiff - tos/chips/at45db/LogStorageP.nc
fix end of log volume handling
[tinyos-2.x.git] / tos / chips / at45db / LogStorageP.nc
index 4f384f275fb970e1346e58892a6926bb0e2a0793..4349e1eb870a5e1a900d394346be7cde2ba8f358 100644 (file)
@@ -633,7 +633,7 @@ implementation
        would end on the last byte of the last page, as this would mean that
        we would not sync the last page, breaking the log volume
        invariant */
-    if (s[client].wpos % vlen >= vlen - len)
+    if ((s[client].wpos - PAGE_SIZE) % vlen >= vlen - len)
       sync();
     else
       {