* In the garbage collector, don't count files with a link count > 1 in

the "bytes/blocks freed" statistics.
This commit is contained in:
Eelco Dolstra 2009-11-24 10:51:52 +00:00
parent f9e766db98
commit 8022015552

View file

@ -297,8 +297,10 @@ static void _deletePath(const Path & path, unsigned long long & bytesFreed,
if (lstat(path.c_str(), &st))
throw SysError(format("getting attributes of path `%1%'") % path);
bytesFreed += st.st_size;
blocksFreed += st.st_blocks;
if (!S_ISDIR(st.st_mode) && st.st_nlink == 1) {
bytesFreed += st.st_size;
blocksFreed += st.st_blocks;
}
if (S_ISDIR(st.st_mode)) {
Strings names = readDirectory(path);