summaryrefslogtreecommitdiffstats
path: root/generic/tclCmdAH.c
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2009-12-28 12:55:48 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2009-12-28 12:55:48 (GMT)
commit000afb3098ed8c8148056fb2638e664b7e2cb3f2 (patch)
treebd4dc4243a573408e161da4ffd15e03e13792cd4 /generic/tclCmdAH.c
parentf9c66cfc9c6e599c938a2873b832c7a9c5b7efaf (diff)
downloadtcl-000afb3098ed8c8148056fb2638e664b7e2cb3f2.zip
tcl-000afb3098ed8c8148056fb2638e664b7e2cb3f2.tar.gz
tcl-000afb3098ed8c8148056fb2638e664b7e2cb3f2.tar.bz2
[Bug 942170]: Detect the st_blocks field of 'struct stat' correctly.
Diffstat (limited to 'generic/tclCmdAH.c')
-rw-r--r--generic/tclCmdAH.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/generic/tclCmdAH.c b/generic/tclCmdAH.c
index 95e6fd8..4edfdec 100644
--- a/generic/tclCmdAH.c
+++ b/generic/tclCmdAH.c
@@ -10,7 +10,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclCmdAH.c,v 1.122 2009/11/18 21:59:51 nijtmans Exp $
+ * RCS: @(#) $Id: tclCmdAH.c,v 1.123 2009/12/28 12:55:48 dkf Exp $
*/
#include "tclInt.h"
@@ -1614,7 +1614,7 @@ StoreStatData(
/*
* Watch out porters; the inode is meant to be an *unsigned* value, so the
- * cast might fail when there isn't a real arithmentic 'long long' type...
+ * cast might fail when there isn't a real arithmetic 'long long' type...
*/
STORE_ARY("dev", Tcl_NewLongObj((long)statPtr->st_dev));
@@ -1623,9 +1623,12 @@ StoreStatData(
STORE_ARY("uid", Tcl_NewLongObj((long)statPtr->st_uid));
STORE_ARY("gid", Tcl_NewLongObj((long)statPtr->st_gid));
STORE_ARY("size", Tcl_NewWideIntObj((Tcl_WideInt)statPtr->st_size));
-#ifdef HAVE_ST_BLOCKS
+#ifdef HAVE_STRUCT_STAT_ST_BLOCKS
STORE_ARY("blocks", Tcl_NewWideIntObj((Tcl_WideInt)statPtr->st_blocks));
#endif
+#ifdef HAVE_STRUCT_STAT_ST_BLKSIZE
+ STORE_ARY("blksize", Tcl_NewLongObj((long)statPtr->st_blksize));
+#endif
STORE_ARY("atime", Tcl_NewLongObj((long)statPtr->st_atime));
STORE_ARY("mtime", Tcl_NewLongObj((long)statPtr->st_mtime));
STORE_ARY("ctime", Tcl_NewLongObj((long)statPtr->st_ctime));