Merge branch 'dvbsi++' of coolstreamtech.de:cst-public-gui-neutrino into dvbsi++

This commit is contained in:
[CST] Focus
2012-10-02 14:10:29 +04:00
7 changed files with 34 additions and 27 deletions

View File

@@ -191,17 +191,18 @@ int check_dir(const char * dir)
return ret;
}
int get_fs_usage(const char * dir)
bool get_fs_usage(const char * dir, long &btotal, long &bused)
{
int ret = 0;
long blocks_used;
btotal = bused = 0;
struct statfs s;
if (::statfs(dir, &s) == 0 && s.f_blocks) {
blocks_used = s.f_blocks - s.f_bfree;
ret = (blocks_used * 100ULL) / s.f_blocks;
btotal = s.f_blocks;
bused = s.f_blocks - s.f_bfree;
//printf("fs (%s): total %ld used %ld\n", dir, btotal, bused);
return true;
}
return ret;
return false;
}
bool get_mem_usage(unsigned long &kbtotal, unsigned long &kbfree)

View File

@@ -31,7 +31,7 @@ int safe_mkdir(char * path);
bool file_exists(const char *filename);
void wakeup_hdd(const char *hdd_dir);
int check_dir(const char * dir);
int get_fs_usage(const char * dir);
bool get_fs_usage(const char * dir, long &total, long &used);
bool get_mem_usage(unsigned long &total, unsigned long &free);
#endif