[BusyBox-cvs] svn commit: trunk/busybox/coreutils
vapier at busybox.net
vapier at busybox.net
Wed Jun 29 01:07:05 UTC 2005
Author: vapier
Date: 2005-06-28 19:07:04 -0600 (Tue, 28 Jun 2005)
New Revision: 10622
Log:
dont use f_frsize unless linux-2.6.0 or better
Modified:
trunk/busybox/coreutils/stat.c
Changeset:
Modified: trunk/busybox/coreutils/stat.c
===================================================================
--- trunk/busybox/coreutils/stat.c 2005-06-29 00:58:06 UTC (rev 10621)
+++ trunk/busybox/coreutils/stat.c 2005-06-29 01:07:04 UTC (rev 10622)
@@ -32,9 +32,15 @@
#include <time.h>
#include <getopt.h>
#include <sys/stat.h>
+#include <sys/statfs.h>
+#include <sys/statvfs.h>
#include <string.h>
#include "busybox.h"
+#ifdef __linux__
+# include <linux/version.h>
+#endif
+
/* vars to control behavior */
#define OPT_TERSE 2
#define OPT_DEREFERNCE 4
@@ -172,9 +178,14 @@
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;
More information about the busybox-cvs
mailing list