CVSROOT:        /sources/hurdextras
Module name:    tarfs
Branch:         
Changes by:     Ludovic Courtes <[EMAIL PROTECTED]>     06/03/08 12:21:39

Modified files:
        .              : ChangeLog fs.c tar.c 

Log message:
        Fixed value of `st_blocks' (Ben Asselstine).

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/hurdextras/tarfs/ChangeLog.diff?tr1=1.2&tr2=1.3&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/hurdextras/tarfs/fs.c.diff?tr1=1.2&tr2=1.3&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/hurdextras/tarfs/tar.c.diff?tr1=1.2&tr2=1.3&r1=text&r2=text

Patches:
Index: tarfs/ChangeLog
diff -u tarfs/ChangeLog:1.2 tarfs/ChangeLog:1.3
--- tarfs/ChangeLog:1.2 Wed Mar  8 08:06:46 2006
+++ tarfs/ChangeLog     Wed Mar  8 12:21:39 2006
@@ -1,3 +1,8 @@
+2006-03-08  Ben Asselstine  <[EMAIL PROTECTED]>
+
+       * tar.c (tar_header2stat): Correctly setting `st_blocks' of ST.
+
+
 2006-03-07  Ben Asselstine  <[EMAIL PROTECTED]>
 
        * store-gzip.c (read_next): remove static from nested
Index: tarfs/fs.c
diff -u tarfs/fs.c:1.2 tarfs/fs.c:1.3
--- tarfs/fs.c:1.2      Wed Mar  8 08:12:44 2006
+++ tarfs/fs.c  Wed Mar  8 12:21:39 2006
@@ -211,7 +211,7 @@
   st.st_nlink   = 1;   /* number of subdir plus two, one otherwise. */
   st.st_size    = 0;
   st.st_blksize = 1024;        /* optimal block size for reading */
-  st.st_blocks  = 1;   /* XXX */
+  st.st_blocks  = 1;
   st.st_gen     = 0;
 
   if (S_ISDIR (m))
Index: tarfs/tar.c
diff -u tarfs/tar.c:1.2 tarfs/tar.c:1.3
--- tarfs/tar.c:1.2     Wed Mar  8 08:06:46 2006
+++ tarfs/tar.c Wed Mar  8 12:21:39 2006
@@ -173,6 +173,10 @@
     }
   //st->st_size = hstat.st_size;
   st->st_size  = from_oct (1 + 12, header->header.size);
+  if (st->st_size > 0)
+    st->st_blocks = ((st->st_size - 1) / 512) + 1;
+  else
+    st->st_blocks = 0;
   st->st_mtime = from_oct (1 + 12, header->header.mtime);
   st->st_atime = from_oct (1 + 12, header->header.atime);
   st->st_ctime = from_oct (1 + 12, header->header.ctime);


_______________________________________________
Hurdextras-commit mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/hurdextras-commit

Reply via email to