summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordavygrvy <davygrvy@noemail.net>2003-11-18 23:13:32 (GMT)
committerdavygrvy <davygrvy@noemail.net>2003-11-18 23:13:32 (GMT)
commitd798e0dea596d89b208edc97cbd078ec6bee63cb (patch)
tree78c875838cb4d96849c2ca39937e21869615cd3a
parent6fe3f1dc32ef73e1e2aff60001bf4f0bd70062c1 (diff)
downloadtcl-d798e0dea596d89b208edc97cbd078ec6bee63cb.zip
tcl-d798e0dea596d89b208edc97cbd078ec6bee63cb.tar.gz
tcl-d798e0dea596d89b208edc97cbd078ec6bee63cb.tar.bz2
Changes from Victor Wagner <vitus@45.free.net> for DJGPP support.
FossilOrigin-Name: c34a3f8b131fd2830b6b930ab03e2cd53d40f100
-rw-r--r--unix/tclUnixChan.c5
-rw-r--r--unix/tclUnixFCmd.c12
2 files changed, 13 insertions, 4 deletions
diff --git a/unix/tclUnixChan.c b/unix/tclUnixChan.c
index bb2b9c0..57a9e5d 100644
--- a/unix/tclUnixChan.c
+++ b/unix/tclUnixChan.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: tclUnixChan.c,v 1.43 2003/10/23 18:00:10 andreas_kupries Exp $
+ * RCS: @(#) $Id: tclUnixChan.c,v 1.44 2003/11/18 23:13:33 davygrvy Exp $
*/
#include "tclInt.h" /* Internal definitions for Tcl. */
@@ -1785,6 +1785,9 @@ TclpOpenFileChannel(interp, pathPtr, mode, permissions)
if (native == NULL) {
return NULL;
}
+#ifdef DJGPP
+ mode |= O_BINARY;
+#endif
fd = TclOSopen(native, mode, permissions);
#ifdef SUPPORTS_TTY
ctl_tty = (strcmp (native, "/dev/tty") == 0);
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);