diff options
author | andreas_kupries <andreas_kupries@noemail.net> | 2006-03-16 18:23:17 (GMT) |
---|---|---|
committer | andreas_kupries <andreas_kupries@noemail.net> | 2006-03-16 18:23:17 (GMT) |
commit | 9264360b81a475a4987e387cdceb321c217608f6 (patch) | |
tree | 58b62966df348210cf51a6066e2b09bf37ac37ac /generic/tclIOUtil.c | |
parent | 13930aabedb046987fa533b050c9f51ddc111b61 (diff) | |
download | tcl-9264360b81a475a4987e387cdceb321c217608f6.zip tcl-9264360b81a475a4987e387cdceb321c217608f6.tar.gz tcl-9264360b81a475a4987e387cdceb321c217608f6.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'.
FossilOrigin-Name: 619938a2cd468db1abdda1329b3afccdb4153713
Diffstat (limited to 'generic/tclIOUtil.c')
-rw-r--r-- | generic/tclIOUtil.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/generic/tclIOUtil.c b/generic/tclIOUtil.c index 84c9161..99240e4 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.77.2.26 2006/02/15 16:04:29 dgp Exp $ + * RCS: @(#) $Id: tclIOUtil.c,v 1.77.2.27 2006/03/16 18:23:22 andreas_kupries Exp $ */ #include "tclInt.h" @@ -1567,7 +1567,11 @@ TclGetOpenMode(interp, string, seekFlagPtr) 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: |