summaryrefslogtreecommitdiffstats
path: root/unix
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2008-09-27 19:48:06 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2008-09-27 19:48:06 (GMT)
commit0f26317d580254d922cc16f4e5586bce2c2d0a31 (patch)
tree6e65eb27b35aeb388245bd4ce32c56845f17a2fa /unix
parent8d3e26a08c2d3528276032ef2b4f40949bd3d08d (diff)
downloadtcl-0f26317d580254d922cc16f4e5586bce2c2d0a31.zip
tcl-0f26317d580254d922cc16f4e5586bce2c2d0a31.tar.gz
tcl-0f26317d580254d922cc16f4e5586bce2c2d0a31.tar.bz2
Reduce the magic number count
Diffstat (limited to 'unix')
-rw-r--r--unix/tclUnixFCmd.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/unix/tclUnixFCmd.c b/unix/tclUnixFCmd.c
index 1f1cf89..689f995 100644
--- a/unix/tclUnixFCmd.c
+++ b/unix/tclUnixFCmd.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: tclUnixFCmd.c,v 1.66 2008/04/27 22:21:34 dkf Exp $
+ * RCS: @(#) $Id: tclUnixFCmd.c,v 1.67 2008/09/27 19:48:06 dkf Exp $
*
* Portions of this code were derived from NetBSD source code which has the
* following copyright notice:
@@ -527,6 +527,8 @@ TclUnixCopyFile(
#define BINMODE
#endif
+#define DEFAULT_COPY_BLOCK_SIZE 4069
+
if ((srcFd = TclOSopen(src, O_RDONLY BINMODE, 0)) < 0) { /* INTL: Native */
return TCL_ERROR;
}
@@ -553,11 +555,11 @@ TclUnixCopyFile(
if (fstatfs(srcFd, &fs, sizeof(fs), 0) == 0) {
blockSize = fs.f_bsize;
} else {
- blockSize = 4096;
+ blockSize = DEFAULT_COPY_BLOCK_SIZE;
}
}
#else
- blockSize = 4096;
+ blockSize = DEFAULT_COPY_BLOCK_SIZE;
#endif /* HAVE_ST_BLKSIZE */
/*
@@ -568,7 +570,7 @@ TclUnixCopyFile(
*/
if (blockSize <= 0) {
- blockSize = 4096;
+ blockSize = DEFAULT_COPY_BLOCK_SIZE;
}
buffer = ckalloc(blockSize);
while (1) {