From ade244b69c5b0827863af8eaa6cf8cc56bc28c82 Mon Sep 17 00:00:00 2001 From: vapier Date: Wed, 29 Jun 2005 01:07:04 +0000 Subject: dont use f_frsize unless linux-2.6.0 or better git-svn-id: svn://busybox.net/trunk/busybox@10622 69ca8d6d-28ef-0310-b511-8ec308f3f277 --- coreutils/stat.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/coreutils/stat.c b/coreutils/stat.c index 33f01deb0..b41e1d3be 100644 --- a/coreutils/stat.c +++ b/coreutils/stat.c @@ -32,9 +32,15 @@ #include #include #include +#include +#include #include #include "busybox.h" +#ifdef __linux__ +# include +#endif + /* vars to control behavior */ #define OPT_TERSE 2 #define OPT_DEREFERNCE 4 @@ -172,9 +178,14 @@ static void print_statfs(char *pformat, size_t buf_len, char m, printf(pformat, (unsigned long int) (statfsbuf->f_bsize)); break; case 'S': { - unsigned long int frsize = statfsbuf->f_frsize; + unsigned long int frsize; +#if defined(__linux__) && LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0) + frsize = statfsbuf->f_frsize; if (!frsize) frsize = statfsbuf->f_bsize; +#else + frsize = statfsbuf->f_bsize; +#endif strncat(pformat, "lu", buf_len); printf(pformat, frsize); break; -- cgit v1.2.3-55-g6feb