diff options
| author | andreask@activestate.com <andreas_kupries> | 2006-11-07 17:29:48 (GMT) |
|---|---|---|
| committer | andreask@activestate.com <andreas_kupries> | 2006-11-07 17:29:48 (GMT) |
| commit | 37318884b59ce50f60e28a9bbfc04f8a1ff73bb7 (patch) | |
| tree | 9cb11083f33237d3a4c900bf26fd0f627988a284 /unix | |
| parent | c84853365cc7b4d99ea25395ee3cc833f31518d6 (diff) | |
| download | tcl-37318884b59ce50f60e28a9bbfc04f8a1ff73bb7.zip tcl-37318884b59ce50f60e28a9bbfc04f8a1ff73bb7.tar.gz tcl-37318884b59ce50f60e28a9bbfc04f8a1ff73bb7.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.
Diffstat (limited to 'unix')
| -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 caadf68..8bf268d 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.58 2006/11/02 15:58:09 dgp Exp $ + * RCS: @(#) $Id: tclUnixFCmd.c,v 1.59 2006/11/07 17:29:48 andreas_kupries Exp $ * * Portions of this code were derived from NetBSD source code which has the * following copyright notice: @@ -541,6 +541,16 @@ TclUnixCopyFile( #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 = (size_t) read(srcFd, buffer, blockSize); |
