From 7bcc4af32c7d36b1f832ce219ad66ab3c9bebfe0 Mon Sep 17 00:00:00 2001 From: Stas Sergeev Date: Mon, 5 Aug 2024 23:15:09 +0300 Subject: [PATCH] use statvfs() instead of non-std statfs() --- src/command.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/command.c b/src/command.c index 7d8c487..9c6121f 100644 --- a/src/command.c +++ b/src/command.c @@ -68,7 +68,7 @@ #include #include #include -#include +#include #include #include #include @@ -2493,7 +2493,7 @@ static void perform_dir(const char *arg) int use_pause = 0; unsigned long long avail; //was double avail; --Salvo finddata_t ff; - struct statfs sf; + struct statvfs sf; int rc; unsigned int attrib = FA_DIREC+FA_RDONLY+FA_ARCH+FA_SYSTEM+FA_HIDDEN, first; unsigned long filecount = 0, dircount = 0, bytecount = 0; @@ -2639,7 +2639,7 @@ static void perform_dir(const char *arg) printf("%10lu file(s) %14lu bytes\n", filecount, bytecount); printf("%10lu dir(s) ", dircount); - rc = statfs(full_filespec, &sf); + rc = statvfs(full_filespec, &sf); if (rc == 0) { avail = (unsigned long long)sf.f_bavail * sf.f_bsize; if (avail < 1048576) @@ -2651,7 +2651,7 @@ static void perform_dir(const char *arg) else printf("%15.1f GB free\n", avail / 1024.0 / 1024.0 / 1024.0); } else { - printf("statfs() failed\n"); + printf("statvfs() failed\n"); } }