Skip to content

Commit 7bcc4af

Browse files
committed
use statvfs() instead of non-std statfs()
1 parent 878dda7 commit 7bcc4af

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/command.c

+4-4
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
#include <stdbool.h>
6969
#include <stdint.h>
7070
#include <sys/stat.h>
71-
#include <sys/vfs.h>
71+
#include <sys/statvfs.h>
7272
#include <stubinfo.h>
7373
#include <process.h>
7474
#include <sys/segments.h>
@@ -2493,7 +2493,7 @@ static void perform_dir(const char *arg)
24932493
int use_pause = 0;
24942494
unsigned long long avail; //was double avail; --Salvo
24952495
finddata_t ff;
2496-
struct statfs sf;
2496+
struct statvfs sf;
24972497
int rc;
24982498
unsigned int attrib = FA_DIREC+FA_RDONLY+FA_ARCH+FA_SYSTEM+FA_HIDDEN, first;
24992499
unsigned long filecount = 0, dircount = 0, bytecount = 0;
@@ -2639,7 +2639,7 @@ static void perform_dir(const char *arg)
26392639
printf("%10lu file(s) %14lu bytes\n", filecount, bytecount);
26402640
printf("%10lu dir(s) ", dircount);
26412641

2642-
rc = statfs(full_filespec, &sf);
2642+
rc = statvfs(full_filespec, &sf);
26432643
if (rc == 0) {
26442644
avail = (unsigned long long)sf.f_bavail * sf.f_bsize;
26452645
if (avail < 1048576)
@@ -2651,7 +2651,7 @@ static void perform_dir(const char *arg)
26512651
else
26522652
printf("%15.1f GB free\n", avail / 1024.0 / 1024.0 / 1024.0);
26532653
} else {
2654-
printf("statfs() failed\n");
2654+
printf("statvfs() failed\n");
26552655
}
26562656
}
26572657

0 commit comments

Comments
 (0)