diff options
| author | davygrvy@pobox.com <davygrvy> | 2003-11-18 23:13:33 (GMT) |
|---|---|---|
| committer | davygrvy@pobox.com <davygrvy> | 2003-11-18 23:13:33 (GMT) |
| commit | 7af188356ced6c494792b97eed3fe81c0084e68a (patch) | |
| tree | 78c875838cb4d96849c2ca39937e21869615cd3a /unix/tclUnixFCmd.c | |
| parent | 633e3beaa05d06219c9b0e6d82f9856d5d42d129 (diff) | |
| download | tcl-7af188356ced6c494792b97eed3fe81c0084e68a.zip tcl-7af188356ced6c494792b97eed3fe81c0084e68a.tar.gz tcl-7af188356ced6c494792b97eed3fe81c0084e68a.tar.bz2 | |
Changes from Victor Wagner <vitus@45.free.net> for DJGPP support.
Diffstat (limited to 'unix/tclUnixFCmd.c')
| -rw-r--r-- | unix/tclUnixFCmd.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/unix/tclUnixFCmd.c b/unix/tclUnixFCmd.c index 7301017..dfbc9d3 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.32 2003/10/13 16:48:07 vincentdarley Exp $ + * RCS: @(#) $Id: tclUnixFCmd.c,v 1.33 2003/11/18 23:13:34 davygrvy Exp $ * * Portions of this code were derived from NetBSD source code which has * the following copyright notice: @@ -471,11 +471,17 @@ TclUnixCopyFile(src, dst, statBufPtr, dontCopyAtts) char *buffer; /* Data buffer for copy */ size_t nread; - if ((srcFd = TclOSopen(src, O_RDONLY, 0)) < 0) { /* INTL: Native. */ +#ifdef DJGPP +#define BINMODE |O_BINARY +#else +#define BINMODE +#endif + + if ((srcFd = TclOSopen(src, O_RDONLY BINMODE, 0)) < 0) { /* INTL: Native. */ return TCL_ERROR; } - dstFd = TclOSopen(dst, O_CREAT|O_TRUNC|O_WRONLY, /* INTL: Native. */ + dstFd = TclOSopen(dst, O_CREAT|O_TRUNC|O_WRONLY BINMODE, /* INTL: Native. */ statBufPtr->st_mode); if (dstFd < 0) { close(srcFd); |
