diff --git a/src/fcstat.c b/src/fcstat.c index d4431e0..d1730fd 100644 --- a/src/fcstat.c +++ b/src/fcstat.c @@ -268,11 +268,11 @@ FcFStatFs (int fd, FcStatFS *statb) int ret = -1; FcBool flag = FcFalse; - memset (statb, 0, sizeof (FcStatFS)); - #if defined(HAVE_FSTATVFS) && (defined(HAVE_STRUCT_STATVFS_F_BASETYPE) || defined(HAVE_STRUCT_STATVFS_F_FSTYPENAME)) struct statvfs buf; + memset (statb, 0, sizeof (FcStatFS)); + if ((ret = fstatvfs (fd, &buf)) == 0) { # if defined(HAVE_STRUCT_STATVFS_F_BASETYPE) @@ -284,6 +284,8 @@ FcFStatFs (int fd, FcStatFS *statb) #elif defined(HAVE_FSTATFS) && (defined(HAVE_STRUCT_STATFS_F_FLAGS) || defined(HAVE_STRUCT_STATFS_F_FSTYPENAME) || defined(__linux__)) struct statfs buf; + memset (statb, 0, sizeof (FcStatFS)); + if ((ret = fstatfs (fd, &buf)) == 0) { # if defined(HAVE_STRUCT_STATFS_F_FLAGS) && defined(MNT_LOCAL)