diff options
author | andreas_kupries <andreas_kupries@noemail.net> | 2006-11-07 17:29:03 (GMT) |
---|---|---|
committer | andreas_kupries <andreas_kupries@noemail.net> | 2006-11-07 17:29:03 (GMT) |
commit | 9694980105e141dfd79f5f844b33936160c18020 (patch) | |
tree | 34dfae5092488e7438c8bc9360e2c66a2d33a80d /unix/tclUnixFCmd.c | |
parent | 0913c1f196de852b7d4e3b47bc7410afc956f0e3 (diff) | |
download | tcl-9694980105e141dfd79f5f844b33936160c18020.zip tcl-9694980105e141dfd79f5f844b33936160c18020.tar.gz tcl-9694980105e141dfd79f5f844b33936160c18020.tar.bz2 |
* unix/tclUnixFCmd.c (CopyFile): [SF Tcl Bug 1586470]. Added code
to fall back to a hardwired default block size should the
filesystem report a bogus value.
FossilOrigin-Name: cee148a2208b299b97df70082b5b26986f5c6489
Diffstat (limited to 'unix/tclUnixFCmd.c')
-rw-r--r-- | unix/tclUnixFCmd.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/unix/tclUnixFCmd.c b/unix/tclUnixFCmd.c index 17432cc..eb48103 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.28.2.13 2006/09/07 18:49:28 vasiljevic Exp $ + * RCS: @(#) $Id: tclUnixFCmd.c,v 1.28.2.14 2006/11/07 17:29:04 andreas_kupries Exp $ * * Portions of this code were derived from NetBSD source code which has * the following copyright notice: @@ -506,6 +506,16 @@ CopyFile(src, dst, statBufPtr) #endif #endif + /* [SF Tcl Bug 1586470] Even if we HAVE_ST_BLKSIZE, there are + * filesystems which report a bogus value for the blocksize. An + * example is the Andrew Filesystem (afs), reporting a blocksize + * of 0. When detecting such a situation we now simply fall back + * to a hardwired default size. + */ + + if (blockSize <= 0) { + blockSize = 4096; + } buffer = ckalloc(blockSize); while (1) { nread = read(srcFd, buffer, blockSize); |