summaryrefslogtreecommitdiffstats
path: root/generic/tclCmdAH.c
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2009-12-28 13:53:40 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2009-12-28 13:53:40 (GMT)
commit28c061614a5610548f9c14ac2b02a06260223f3c (patch)
tree9c91a854f863f5c7082c60168418c2fc5a9410ed /generic/tclCmdAH.c
parent016e636e5322d845b59bb6ecd6754894b9a98aec (diff)
downloadtcl-28c061614a5610548f9c14ac2b02a06260223f3c.zip
tcl-28c061614a5610548f9c14ac2b02a06260223f3c.tar.gz
tcl-28c061614a5610548f9c14ac2b02a06260223f3c.tar.bz2
[Bug 942170]: Detect the st_blocks field of 'struct stat' correctly.
Diffstat (limited to 'generic/tclCmdAH.c')
-rw-r--r--generic/tclCmdAH.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/generic/tclCmdAH.c b/generic/tclCmdAH.c
index abcb083..5b7cd34 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.93.2.1 2008/07/21 19:38:17 andreas_kupries Exp $
+ * RCS: @(#) $Id: tclCmdAH.c,v 1.93.2.2 2009/12/28 13:53:40 dkf Exp $
*/
#include "tclInt.h"
@@ -1500,13 +1500,13 @@ StoreStatData(
*/
#define STORE_ARY(fieldName, object) \
- TclNewLiteralStringObj(field, fieldName); \
- Tcl_IncrRefCount(field); \
- value = (object); \
+ TclNewLiteralStringObj(field, fieldName); \
+ Tcl_IncrRefCount(field); \
+ value = (object); \
if (Tcl_ObjSetVar2(interp,varName,field,value,TCL_LEAVE_ERR_MSG)==NULL) { \
- TclDecrRefCount(field); \
- return TCL_ERROR; \
- } \
+ TclDecrRefCount(field); \
+ return TCL_ERROR; \
+ } \
TclDecrRefCount(field);
/*
@@ -1520,9 +1520,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));