[dev] [sbase] Problem tar archiving the output file

From: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
Date: Sat, 20 Jul 2013 09:47:34 +0200

Hi,

        When tar has to archiving the same directory where the
output file is located, (for example with something like
tar cf f.tar .) it enters in a infinite loop in:

_AT_archive

        while((l = fread(b, 1, Blksiz, f)) > 0) {
               if(l < Blksiz)
                        memset(b+l, 0, Blksiz-l);
                fwrite(b, Blksiz, 1, tarfile);
        }



        One solution could be ignore the tar file (maybe using
realpath(3)), or call to stat and get the size of the file
before archiving it.




-- 
Roberto E. Vargas Caballero
----------------------------
k0ga_AT_shike2.com
http://www.shike2.com
Received on Sat Jul 20 2013 - 09:47:34 CEST

This archive was generated by hypermail 2.3.0 : Sat Jul 20 2013 - 10:00:04 CEST