summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authorandreas_kupries <akupries@shaw.ca>2006-03-16 18:22:54 (GMT)
committerandreas_kupries <akupries@shaw.ca>2006-03-16 18:22:54 (GMT)
commit25f7e2b1839da7e468041414cb962fd468bfa35c (patch)
tree9a1ede11503c4ab3597c045e1fee0c877cfb1a48 /generic
parent50eba7c70e2d665ecb30510700338e784228439b (diff)
downloadtcl-25f7e2b1839da7e468041414cb962fd468bfa35c.zip
tcl-25f7e2b1839da7e468041414cb962fd468bfa35c.tar.gz
tcl-25f7e2b1839da7e468041414cb962fd468bfa35c.tar.bz2
* generic/tclIOUtil.c (TclGetOpenMode): Added the flag O_APPEND to
the list of POSIX modes used when opening a file for 'a'ppend. This enables the proper automatic seek-to-end-on-write by the OS. See [Bug 680143] for longer discussion. * tests/ioCmd.test (iocmd-13.7.*): Extended the testsuite to check the new handling of 'a'.
Diffstat (limited to 'generic')
-rw-r--r--generic/tclIOUtil.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/generic/tclIOUtil.c b/generic/tclIOUtil.c
index 35cd59f..e281026 100644
--- a/generic/tclIOUtil.c
+++ b/generic/tclIOUtil.c
@@ -17,7 +17,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclIOUtil.c,v 1.128 2006/02/15 15:43:55 dgp Exp $
+ * RCS: @(#) $Id: tclIOUtil.c,v 1.129 2006/03/16 18:22:57 andreas_kupries Exp $
*/
#include "tclInt.h"
@@ -1558,7 +1558,11 @@ TclGetOpenModeEx(
mode = O_WRONLY|O_CREAT|O_TRUNC;
break;
case 'a':
- mode = O_WRONLY|O_CREAT;
+ /* [Bug 680143].
+ * Added O_APPEND for proper automatic
+ * seek-to-end-on-write by the OS.
+ */
+ mode = O_WRONLY|O_CREAT|O_APPEND;
*seekFlagPtr = 1;
break;
default: