Free disk space reporting fixes.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@9039 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Jonathan Gapen 2001-02-07 21:30:25 +00:00
parent e8cf2df164
commit 087c35f0f9
2 changed files with 7 additions and 2 deletions

View file

@ -1,3 +1,8 @@
2001-02-07 Jonathan Gapen <jagapen@home.com>
* Source/NSFileManager.m: Make disk space report work on FreeBSD.
On all Unix platforms, report disk space available to non-root users.
2001-02-07 Richard Frith-Macdonald <rfm@gnu.org>
* Source/GSFormat.m: merged in some more fixes by Kai.

View file

@ -949,7 +949,7 @@ static NSFileManager* defaultManager = nil;
return [NSDictionary dictionaryWithObjects: values forKeys: keys count: 5];
#else
#if HAVE_SYS_VFS_H || HAVE_SYS_STATFS_H
#if HAVE_SYS_VFS_H || HAVE_SYS_STATFS_H || HAVE_SYS_MOUNT_H
struct stat statbuf;
#if HAVE_STATVFS
struct statvfs statfsbuf;
@ -980,7 +980,7 @@ static NSFileManager* defaultManager = nil;
#endif
totalsize = statfsbuf.f_bsize * statfsbuf.f_blocks;
freesize = statfsbuf.f_bsize * statfsbuf.f_bfree;
freesize = statfsbuf.f_bsize * statfsbuf.f_bavail;
values[0] = [NSNumber numberWithLongLong: totalsize];
values[1] = [NSNumber numberWithLongLong: freesize];