From eae8ab2a6a0b8827a23e2ce6c806d9f3bcf1a09a Mon Sep 17 00:00:00 2001 From: Tejas Bubane Date: Tue, 17 Dec 2013 18:40:08 +0530 Subject: [PATCH] Fix bug in disk_usage.c --- server/data_providers/disk_usage.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/server/data_providers/disk_usage.c b/server/data_providers/disk_usage.c index 3987f59..76f5406 100755 --- a/server/data_providers/disk_usage.c +++ b/server/data_providers/disk_usage.c @@ -3,13 +3,14 @@ static VALUE get_disk_usage(VALUE self, VALUE mount_point) { - char* mount_point_str = RSTRING(mount_point)->ptr; + struct statvfs result; + char* mount_point_str = RSTRING_PTR(mount_point); VALUE out_hash = rb_hash_new(); rb_hash_aset(out_hash, rb_str_new2("free"), Qnil); rb_hash_aset(out_hash, rb_str_new2("total"), Qnil); - struct statvfs result; + //struct statvfs result; <-- ISO C90 forbids mixed declarations and code if(statvfs(mount_point_str, &result) == 0) {