diff options
author | Simon Rettberg | 2014-06-16 19:24:17 +0200 |
---|---|---|
committer | Simon Rettberg | 2014-06-16 19:24:17 +0200 |
commit | 49f9218d330f5842fe24bce79267bd2c5b239df3 (patch) | |
tree | 74e7b49e9c058145069ac4e2aa6de5d9f2cac3ce /src/server/fileutil.c | |
parent | [CLIENT] Debug argument handling in daemon mode (diff) | |
download | dnbd3-49f9218d330f5842fe24bce79267bd2c5b239df3.tar.gz dnbd3-49f9218d330f5842fe24bce79267bd2c5b239df3.tar.xz dnbd3-49f9218d330f5842fe24bce79267bd2c5b239df3.zip |
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...
Diffstat (limited to 'src/server/fileutil.c')
-rw-r--r-- | src/server/fileutil.c | 6 |
1 files changed, 3 insertions, 3 deletions
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) |