From: Alain Spineux Date: Mon, 26 Jun 2023 09:45:32 +0000 (+0200) Subject: fix ifdef logic in fs_get_free_space() X-Git-Tag: Beta-15.0.0~169 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a021f22d18922c0ad7a98abb6bfe93ea3e644680;p=thirdparty%2Fbacula.git fix ifdef logic in fs_get_free_space() - this #if defined(HAVE_WIN32) #elif defined(HAVE_SYS_STATVFS_H) || !defined(HAVE_WIN32) #endif is equivalent to #if defined(HAVE_WIN32) #else #endif as the HAVE_WIN32 are in the if and the elif - there is no reason to "care" about "statvfs()" as the fallback is to use statfs (see the line above, that I reproduce here): #ifdef HAVE_SYS_STATVFS_H #include #else #define statvfs statfs #endif - the other commits related to this piece of code are c8d10999f1789b88f9f93d29b512e7af10fd009d 33b01b743fa5629828f61fa1300234785c999afa db82b457bf1dede1225a53c37e60d2d30af84b3b --- diff --git a/bacula/src/lib/bsys.c b/bacula/src/lib/bsys.c index 549ec317b..1211fb1c9 100644 --- a/bacula/src/lib/bsys.c +++ b/bacula/src/lib/bsys.c @@ -1305,11 +1305,8 @@ int fs_get_free_space(const char *path, int64_t *freeval, int64_t *totalval) BOOL ret = GetDiskFreeSpaceExA(path, NULL, (PULARGE_INTEGER)totalval, (PULARGE_INTEGER)freeval); if (ret) { return 0; - } else { - return -1; } - -#elif defined(HAVE_SYS_STATVFS_H) || !defined(HAVE_WIN32) +#else struct statvfs st; if (statvfs(path, &st) == 0) {