From 49f9218d330f5842fe24bce79267bd2c5b239df3 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Mon, 16 Jun 2014 19:24:17 +0200 Subject: Improve uplink handling, add code to debug thread creation/destruction, change stupid convention of freeDiskSpace returning 0 on error, which is ambiguous to the disk simply being full... --- src/server/fileutil.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/server/fileutil.c') diff --git a/src/server/fileutil.c b/src/server/fileutil.c index 0cb1894..5adc90a 100644 --- a/src/server/fileutil.c +++ b/src/server/fileutil.c @@ -58,13 +58,13 @@ int file_alloc(int fd, uint64_t offset, uint64_t size) return TRUE; } -uint64_t file_freeDiskSpace(const char * const path) +int64_t file_freeDiskSpace(const char * const path) { struct statvfs fiData; if ( (statvfs( path, &fiData )) < 0 ) { - return 0; + return -1; } - return ((uint64_t)fiData.f_bavail * (uint64_t)fiData.f_bsize); + return ((int64_t)fiData.f_bavail * (int64_t)fiData.f_bsize); } time_t file_lastModification(const char * const file) -- cgit v1.2.3-55-g7522