bloopletech-webstats 0.2.4 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION.yml +2 -2
- data/server/data_providers/disk_usage.c +5 -5
- data/webstats.gemspec +1 -1
- metadata +1 -1
data/VERSION.yml
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
#include <ruby.h>
|
2
|
-
#include <sys/
|
2
|
+
#include <sys/statvfs.h>
|
3
3
|
|
4
4
|
static VALUE get_disk_usage(VALUE self, VALUE mount_point)
|
5
5
|
{
|
@@ -9,12 +9,12 @@ static VALUE get_disk_usage(VALUE self, VALUE mount_point)
|
|
9
9
|
rb_hash_aset(out_hash, rb_str_new2("free"), Qnil);
|
10
10
|
rb_hash_aset(out_hash, rb_str_new2("total"), Qnil);
|
11
11
|
|
12
|
-
struct
|
12
|
+
struct statvfs result;
|
13
13
|
|
14
|
-
if(
|
14
|
+
if(statvfs(mount_point_str, &result) == 0)
|
15
15
|
{
|
16
|
-
rb_hash_aset(out_hash, rb_str_new2("free"), LL2NUM((long long)result.
|
17
|
-
rb_hash_aset(out_hash, rb_str_new2("total"), LL2NUM((long long)result.f_blocks * (long long)result.
|
16
|
+
rb_hash_aset(out_hash, rb_str_new2("free"), LL2NUM((long long)result.f_bavail * (long long)result.f_frsize));
|
17
|
+
rb_hash_aset(out_hash, rb_str_new2("total"), LL2NUM((long long)result.f_blocks * (long long)result.f_frsize));
|
18
18
|
}
|
19
19
|
|
20
20
|
return out_hash;
|
data/webstats.gemspec
CHANGED