diff options
author | Dan McGee <dan@archlinux.org> | 2011-02-07 21:33:30 -0600 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2011-02-08 09:28:24 -0600 |
commit | 942bb9e64a7ba11e5f2a0db374bcaa21868eceb6 (patch) | |
tree | 25c9c5dcfc1ed483ec180e1a60dc49aaa7eb3b4f /lib/libalpm/diskspace.h | |
parent | da3b93460258fd24e2535360586fea668fa055fb (diff) | |
download | pacman-942bb9e64a7ba11e5f2a0db374bcaa21868eceb6.tar.xz |
Skip diskspace checking for symlinks and directories in all cases
We did this in some but not all cases, assuming the 0 value coming out of
libarchive would not be a problem. However, this does not work for "fake"
filesystems such as rpc_pipefs, which reports a free block and total block
count of zero.
Fix this by not ever counting symlinks or directories, and adding a note
explaining that if we someday do count directories, their size needs to be
attributed to the proper place.
This patch also includes a few cleanups/performance tweaks- avoid calling
strlen() on the mountpoint directory string as much by storing this size in
our mountpoint struct, and push the snprintf() call up to the calculate
functions since we were already doing it here in the remove case.
Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'lib/libalpm/diskspace.h')
-rw-r--r-- | lib/libalpm/diskspace.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/libalpm/diskspace.h b/lib/libalpm/diskspace.h index 25b9cfbf..ae99d0c8 100644 --- a/lib/libalpm/diskspace.h +++ b/lib/libalpm/diskspace.h @@ -32,6 +32,7 @@ typedef struct __alpm_mountpoint_t { /* mount point information */ char *mount_dir; + size_t mount_dir_len; /* storage for additional disk usage calculations */ long blocks_needed; long max_blocks_needed; |