Bugfix for systems that don't have an S_BLKSIZE of 512
git-svn-id: svn://blicky.net/ncdu/trunk@29 ce56bc8d-f834-0410-b703-f827bd498a76
Этот коммит содержится в:
родитель
8a71f8860c
Коммит
abeb59fe30
@ -311,7 +311,7 @@ int calcDir(struct dir *dest, char *path) {
|
||||
|
||||
/* count the size */
|
||||
if(!(d->flags & FF_EXL || d->flags & FF_OTHFS)) {
|
||||
d->size = fs.st_blocks * 512;
|
||||
d->size = fs.st_blocks * S_BLKSIZE;
|
||||
d->asize = fs.st_size;
|
||||
for(t = dest; t != NULL; t = t->parent) {
|
||||
t->size += d->size;
|
||||
@ -376,7 +376,7 @@ struct dir *showCalc(char *path) {
|
||||
return(NULL);
|
||||
}
|
||||
parent = calloc(sizeof(struct dir), 1);
|
||||
parent->size = fs.st_blocks * 512;
|
||||
parent->size = fs.st_blocks * S_BLKSIZE;
|
||||
parent->asize = fs.st_size;
|
||||
parent->flags |= FF_DIR;
|
||||
curdev = fs.st_dev;
|
||||
|
@ -44,6 +44,11 @@
|
||||
#include <sys/time.h>
|
||||
#include <dirent.h>
|
||||
|
||||
/* set S_BLKSIZE if not defined already in sys/stat.h */
|
||||
#ifndef S_BLKSIZE
|
||||
# define S_BLKSIZE 512
|
||||
#endif
|
||||
|
||||
/* PATH_MAX 260 on Cygwin is too small for /proc/registry */
|
||||
#ifdef __CYGWIN__
|
||||
# if PATH_MAX < 1024
|
||||
|
Загрузка…
Ссылка в новой задаче
Block a user