summaryrefslogtreecommitdiff
path: root/sysutils/torsmo/files/patch-fs.c
diff options
context:
space:
mode:
authorGreg Lewis <glewis@FreeBSD.org>2004-08-06 18:00:53 +0000
committerGreg Lewis <glewis@FreeBSD.org>2004-08-06 18:00:53 +0000
commit3d2373ec2c1a9ce549a39ee3df01d26df1289936 (patch)
treedae87855c5d1076a88cb850a4868f8bdae46e90a /sysutils/torsmo/files/patch-fs.c
parentPerl 5.8.4 and above add several security check when doing setuid. (diff)
. Add ACPI support. [1]
. Make this compile on FreeBSD 4.x. I've hacked the version being committed to actually compile on 4.x. The submitted patch only partially fixed 4.x build problems. [2] PR: 70039 [1], 70041 [2] Submitted by: Roman Bogorodskiy <bogorodskiy@inbox.ru> (maintainer)
Notes
Notes: svn path=/head/; revision=115518
Diffstat (limited to 'sysutils/torsmo/files/patch-fs.c')
-rw-r--r--sysutils/torsmo/files/patch-fs.c37
1 files changed, 37 insertions, 0 deletions
diff --git a/sysutils/torsmo/files/patch-fs.c b/sysutils/torsmo/files/patch-fs.c
new file mode 100644
index 000000000000..206307a97006
--- /dev/null
+++ b/sysutils/torsmo/files/patch-fs.c
@@ -0,0 +1,37 @@
+--- fs.c.orig Thu Aug 5 19:59:50 2004
++++ fs.c Thu Aug 5 20:01:50 2004
+@@ -3,10 +3,12 @@
+ #include <stdlib.h>
+ #include <string.h>
+ #include <errno.h>
+-#include <sys/statvfs.h>
+ #include <sys/types.h>
+ #include <fcntl.h>
+
++#include <sys/param.h>
++#include <sys/mount.h>
++
+ /* TODO: benchmark which is faster, fstatvfs() or pre-opened fd and
+ * statvfs() (fstatvfs() would handle mounts I think...) */
+
+@@ -15,16 +17,16 @@
+
+ void update_fs_stats() {
+ unsigned int i;
+- struct statvfs s;
++ struct statfs s;
+ for (i=0; i<16; i++) {
+ if (fs_stats[i].fd <= 0)
+ break;
+
+- fstatvfs(fs_stats[i].fd, &s);
++ fstatfs(fs_stats[i].fd, &s);
+
+- fs_stats[i].size = (long long) s.f_blocks * s.f_frsize;
++ fs_stats[i].size = (long long) s.f_blocks * s.f_bsize;
+ /* bfree (root) or bavail (non-roots) ? */
+- fs_stats[i].avail = (long long) s.f_bavail * s.f_frsize;
++ fs_stats[i].avail = (long long) s.f_bavail * s.f_bsize;
+ }
+ }
+