summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2010-02-16 16:01:32 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2010-02-16 16:01:32 (GMT)
commitc0764272261c0f8e727f1c2a5e1d1acff40454f3 (patch)
treef87e69815fc9cbbdae4123c2ed8a23e6d5e4a890
parent85d00a55b79e0beebaf4875584cf7391abd05392 (diff)
downloadtcl-c0764272261c0f8e727f1c2a5e1d1acff40454f3.zip
tcl-c0764272261c0f8e727f1c2a5e1d1acff40454f3.tar.gz
tcl-c0764272261c0f8e727f1c2a5e1d1acff40454f3.tar.bz2
Do not assume that all unix systems have the POSIX blkcnt_t type, since OpenBSD
apparently does not.
-rw-r--r--ChangeLog4
-rw-r--r--generic/tclIOUtil.c6
-rw-r--r--unix/configure.in6
3 files changed, 13 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 9b1b4d7..568fba3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
2010-02-16 Donal K. Fellows <dkf@users.sf.net>
+ * unix/configure.in, generic/tclIOUtil.c (Tcl_Stat): Updated so that
+ we do not assume that all unix systems have the POSIX blkcnt_t type,
+ since OpenBSD apparently does not.
+
* generic/tclLiteral.c (HashString): Missed updating to FNV in one
place; the literal table (a copy of the hash table code...)
diff --git a/generic/tclIOUtil.c b/generic/tclIOUtil.c
index a077bab..905b8ca 100644
--- a/generic/tclIOUtil.c
+++ b/generic/tclIOUtil.c
@@ -17,7 +17,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclIOUtil.c,v 1.166 2009/12/28 12:55:48 dkf Exp $
+ * RCS: @(#) $Id: tclIOUtil.c,v 1.167 2010/02/16 16:01:33 dkf Exp $
*/
#include "tclInt.h"
@@ -292,7 +292,11 @@ Tcl_Stat(
oldStyleBuf->st_blksize = buf.st_blksize;
#endif
#ifdef HAVE_STRUCT_STAT_ST_BLOCKS
+#ifdef HAVE_BLKCNT_T
oldStyleBuf->st_blocks = (blkcnt_t) buf.st_blocks;
+#else
+ oldStyleBuf->st_blocks = (unsigned long) buf.st_blocks;
+#endif
#endif
}
return ret;
diff --git a/unix/configure.in b/unix/configure.in
index 17e35ed..d2b62a2 100644
--- a/unix/configure.in
+++ b/unix/configure.in
@@ -3,7 +3,7 @@ dnl This file is an input file used by the GNU "autoconf" program to
dnl generate the file "configure", which is run during Tcl installation
dnl to configure the system for the local environment.
#
-# RCS: @(#) $Id: configure.in,v 1.209 2009/12/28 12:55:48 dkf Exp $
+# RCS: @(#) $Id: configure.in,v 1.210 2010/02/16 16:01:33 dkf Exp $
AC_INIT([tcl],[8.6])
AC_PREREQ(2.59)
@@ -279,10 +279,12 @@ SC_TIME_HANDLER
#--------------------------------------------------------------------
# Some systems (e.g., IRIX 4.0.5) lack some fields in struct stat. But
-# we might be able to use fstatfs instead.
+# we might be able to use fstatfs instead. Some systems (OpenBSD?) also
+# lack blkcnt_t.
#--------------------------------------------------------------------
AC_CHECK_MEMBERS([struct stat.st_blocks, struct stat.st_blksize])
+AC_CHECK_TYPES([blkcnt_t])
AC_CHECK_FUNC(fstatfs, , [AC_DEFINE(NO_FSTATFS, 1, [Do we have fstatfs()?])])
#--------------------------------------------------------------------