From 2c767d14d16c2daa63ad938e723ae34afad60d38 Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Mon, 7 Oct 2013 22:26:59 +0200 Subject: [PATCH] src/system/helpers.cpp: Replace wrong data types in get_fs_usage() - Change from 'long' to 'uint64_t' - src/Makefile.am: Add -D_FILE_OFFSET_BITS=64 to AM_CPPFLAGS Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/36f3579df6da98ffb401604da61ee74f21af0cdd Author: Michael Liebmann Date: 2013-10-07 (Mon, 07 Oct 2013) --- src/Makefile.am | 2 +- src/system/helpers.cpp | 4 ++-- src/system/helpers.h | 3 ++- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/Makefile.am b/src/Makefile.am index 408a6db3d..3d73cf35f 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -46,7 +46,7 @@ bin_PROGRAMS = neutrino neutrino_SOURCES = neutrino_menue.cpp neutrino.cpp -AM_CPPFLAGS = +AM_CPPFLAGS = -D_FILE_OFFSET_BITS=64 if ENABLE_FLAC FLACLIBS = -lFLAC diff --git a/src/system/helpers.cpp b/src/system/helpers.cpp index 892ab64bb..9e36c24fc 100644 --- a/src/system/helpers.cpp +++ b/src/system/helpers.cpp @@ -241,7 +241,7 @@ int check_dir(const char * dir, bool allow_tmp) return ret; } -bool get_fs_usage(const char * dir, long &btotal, long &bused, long *bsize/*=NULL*/) +bool get_fs_usage(const char * dir, uint64_t &btotal, uint64_t &bused, long *bsize/*=NULL*/) { btotal = bused = 0; struct statfs s; @@ -251,7 +251,7 @@ bool get_fs_usage(const char * dir, long &btotal, long &bused, long *bsize/*=NUL bused = s.f_blocks - s.f_bfree; if (bsize != NULL) *bsize = s.f_bsize; - //printf("fs (%s): total %ld used %ld\n", dir, btotal, bused); + //printf("fs (%s): total %llu used %llu\n", dir, btotal, bused); return true; } return false; diff --git a/src/system/helpers.h b/src/system/helpers.h index a146e8713..d2b774e1c 100644 --- a/src/system/helpers.h +++ b/src/system/helpers.h @@ -22,6 +22,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ +#include #include int my_system(const char * cmd); @@ -33,7 +34,7 @@ off_t file_size(const char *filename); bool file_exists(const char *filename); void wakeup_hdd(const char *hdd_dir); int check_dir(const char * dir, bool allow_tmp = false); -bool get_fs_usage(const char * dir, long &total, long &used, long *bsize=NULL); +bool get_fs_usage(const char * dir, uint64_t &btotal, uint64_t &bused, long *bsize=NULL); bool get_mem_usage(unsigned long &total, unsigned long &free); std::string getPathName(std::string &path);