summaryrefslogtreecommitdiffstats
path: root/unix
diff options
context:
space:
mode:
authorvincentdarley <vincentdarley>2002-07-08 10:08:57 (GMT)
committervincentdarley <vincentdarley>2002-07-08 10:08:57 (GMT)
commit6cf4fe89feaa9ef6da9ddded6f2199f76d00e73e (patch)
tree44cae45dd1f262fcc31e6d07b240050fb7e44481 /unix
parent11a54cb010fa27ab006f13181b40da00a4f87550 (diff)
downloadtcl-6cf4fe89feaa9ef6da9ddded6f2199f76d00e73e.zip
tcl-6cf4fe89feaa9ef6da9ddded6f2199f76d00e73e.tar.gz
tcl-6cf4fe89feaa9ef6da9ddded6f2199f76d00e73e.tar.bz2
fs cleanup
Diffstat (limited to 'unix')
-rw-r--r--unix/tclUnixChan.c25
1 files changed, 4 insertions, 21 deletions
diff --git a/unix/tclUnixChan.c b/unix/tclUnixChan.c
index 8bc67e2..d6a6e68 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.36 2002/06/28 09:56:54 dkf Exp $
+ * RCS: @(#) $Id: tclUnixChan.c,v 1.37 2002/07/08 10:08:58 vincentdarley Exp $
*/
#include "tclInt.h" /* Internal definitions for Tcl. */
@@ -1746,17 +1746,16 @@ TtyInit(fd, initialize)
*/
Tcl_Channel
-TclpOpenFileChannel(interp, pathPtr, modeString, permissions)
+TclpOpenFileChannel(interp, pathPtr, mode, permissions)
Tcl_Interp *interp; /* Interpreter for error reporting;
* can be NULL. */
Tcl_Obj *pathPtr; /* Name of file to open. */
- CONST char *modeString; /* A list of POSIX open modes or
- * a string such as "rw". */
+ int mode; /* POSIX open mode. */
int permissions; /* If the open involves creating a
* file, with what modes to create
* it? */
{
- int fd, seekFlag, mode, channelPermissions;
+ int fd, channelPermissions;
FileState *fsPtr;
CONST char *native, *translation;
char channelName[16 + TCL_INTEGER_SPACE];
@@ -1768,10 +1767,6 @@ TclpOpenFileChannel(interp, pathPtr, modeString, permissions)
ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey);
#endif /* DEPRECATED */
- mode = TclGetOpenMode(interp, modeString, &seekFlag);
- if (mode == -1) {
- return NULL;
- }
switch (mode & (O_RDONLY | O_WRONLY | O_RDWR)) {
case O_RDONLY:
channelPermissions = TCL_READABLE;
@@ -1848,18 +1843,6 @@ TclpOpenFileChannel(interp, pathPtr, modeString, permissions)
fsPtr->channel = Tcl_CreateChannel(channelTypePtr, channelName,
(ClientData) fsPtr, channelPermissions);
- if (seekFlag) {
- if (Tcl_Seek(fsPtr->channel, (Tcl_WideInt)0,
- SEEK_END) < (Tcl_WideInt)0) {
- if (interp != (Tcl_Interp *) NULL) {
- Tcl_AppendResult(interp, "couldn't seek to end of file on \"",
- channelName, "\": ", Tcl_PosixError(interp), NULL);
- }
- Tcl_Close(NULL, fsPtr->channel);
- return NULL;
- }
- }
-
if (translation != NULL) {
/*
* Gotcha. Most modems need a "\r" at the end of the command