summaryrefslogtreecommitdiff
path: root/sysutils/filelight/files/patch-filetree.cpp
diff options
context:
space:
mode:
authorKirill Ponomarev <krion@FreeBSD.org>2003-08-29 23:43:48 +0000
committerKirill Ponomarev <krion@FreeBSD.org>2003-08-29 23:43:48 +0000
commitabcbc8b2329ca2eb72a436ef84deadfd3d0a9b07 (patch)
tree23f59abb41125a8aab302f09ecd5bd4c3806c7bc /sysutils/filelight/files/patch-filetree.cpp
parent- Fix build on -current (varargs -> stdargs in embedded tcl) (diff)
- New port: sysutils/filelight
Filelight graphically represents a file system as a set of concentric segmented-rings, indicating where diskspace is being used. Segments expanding from the center represent files (including directories), with each segment's size being proportional to the file's size and directories having child segments. PR: 56152 Submitted by: Markus Brueffer <brueffer@phoenix-systems.de>
Notes
Notes: svn path=/head/; revision=88014
Diffstat (limited to 'sysutils/filelight/files/patch-filetree.cpp')
-rw-r--r--sysutils/filelight/files/patch-filetree.cpp51
1 files changed, 51 insertions, 0 deletions
diff --git a/sysutils/filelight/files/patch-filetree.cpp b/sysutils/filelight/files/patch-filetree.cpp
new file mode 100644
index 000000000000..b1d1ca544c81
--- /dev/null
+++ b/sysutils/filelight/files/patch-filetree.cpp
@@ -0,0 +1,51 @@
+--- filelight/filetree.cpp.orig Fri Aug 29 18:06:32 2003
++++ filelight/filetree.cpp Fri Aug 29 18:19:06 2003
+@@ -77,7 +77,7 @@
+ }
+
+
+-static int selector( struct dirent64 const *ent )
++static int selector( struct dirent *ent )
+ {
+ if( (strcmp( ent->d_name, "." ) == 0) || (strcmp( ent->d_name, ".." ) == 0) )
+ return 0;
+@@ -93,16 +93,16 @@
+ if( m_haltScan ) return NULL;
+
+ //the 64bit version lets us support more than 2GB files
+- struct dirent64 **eps;
++ struct dirent **eps;
+ int n;
+
+
+- n = scandir64( path, &eps, selector, /*alphasort*/ NULL );
++ n = scandir( path, &eps, selector, /*alphasort*/ NULL );
+
+ if( n >= 0 ) {
+
+ char *new_path, *new_dirname;
+- struct stat64 statbuf;
++ struct stat statbuf;
+ unsigned char strlen_path = strlen( path ) + 2; //saves recalculations
+ Directory *cwd = new Directory( dirname );
+ Filesize dirsize = 0;
+@@ -121,7 +121,7 @@
+ */
+
+ //get some more detail about the file with lstat
+- lstat64( new_path, &statbuf );
++ lstat( new_path, &statbuf );
+ statbuf.st_size /= 1024; //using units of kB as 32bit max is 4GB and 64bit ints are expensive
+
+ if( S_ISLNK( statbuf.st_mode ) )
+@@ -260,8 +260,9 @@
+
+ #include <fstab.h>
+ #include <mntent.h>
++#ifndef __FreeBSD__
+ #include <sys/statfs.h>
+-
++#endif
+
+ #define INFO_PARTITIONS "/proc/partitions"
+ #define INFO_MOUNTED_PARTITIONS "/etc/mtab" /* on Linux... */