diff options
author | das <das> | 2003-03-03 20:22:35 (GMT) |
---|---|---|
committer | das <das> | 2003-03-03 20:22:35 (GMT) |
commit | 55bb78dc4fdf14318cfcbbeb264b7ef0a3e0a57e (patch) | |
tree | 775cc0d3807a1e773d6bf08be556d649fee410ef /mac/tclMacChan.c | |
parent | dcffed8c8901fe70eb77440945d36aad3f95b6e9 (diff) | |
download | tcl-55bb78dc4fdf14318cfcbbeb264b7ef0a3e0a57e.zip tcl-55bb78dc4fdf14318cfcbbeb264b7ef0a3e0a57e.tar.gz tcl-55bb78dc4fdf14318cfcbbeb264b7ef0a3e0a57e.tar.bz2 |
Mac OS Classic specific fixes:core_8_4_2
* generic/tclIOUtil.c (TclNewFSPathObj): on TCL_PLATFORM_MAC,
skip potential directory separator at the beginning of addStrRep.
* mac/tclMacChan.c (OpenFileChannel, CommonWatch): followup
fixes to cut and splice implementation for file channels.
* mac/tclMacFile.c (TclpUtime): pass native path to utime().
* mac/tclMacFile.c (TclpObjLink): correctly implemented creation
of alias files via new static proc CreateAliasFile().
* mac/tclMacPort.h: define S_ISLNK macro to fix stat'ing of links.
* mac/tclMacUtil.c (FSpLocationFromPathAlias): fix to enable
stat'ing of broken links.
Diffstat (limited to 'mac/tclMacChan.c')
-rw-r--r-- | mac/tclMacChan.c | 33 |
1 files changed, 8 insertions, 25 deletions
diff --git a/mac/tclMacChan.c b/mac/tclMacChan.c index 414309e..555e333 100644 --- a/mac/tclMacChan.c +++ b/mac/tclMacChan.c @@ -9,7 +9,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclMacChan.c,v 1.20 2003/02/21 20:11:35 das Exp $ + * RCS: @(#) $Id: tclMacChan.c,v 1.21 2003/03/03 20:22:42 das Exp $ */ #include "tclInt.h" @@ -801,7 +801,10 @@ OpenFileChannel( short fileRef; FileState *fileState; char channelName[16 + TCL_INTEGER_SPACE]; + ThreadSpecificData *tsdPtr; + tsdPtr = FileInit(); + /* * Note we use fsRdWrShPerm instead of fsRdWrPerm which allows shared * writes on a file. This isn't common on a mac but is common with @@ -874,6 +877,8 @@ OpenFileChannel( } fileState->fileChan = chan; + fileState->nextPtr = tsdPtr->firstFilePtr; + tsdPtr->firstFilePtr = fileState; fileState->volumeRef = fileSpec.vRefNum; fileState->fileRef = fileRef; fileState->pending = 0; @@ -1195,34 +1200,12 @@ CommonWatch( * combination of TCL_READABLE, * TCL_WRITABLE and TCL_EXCEPTION. */ { - FileState **nextPtrPtr, *ptr; FileState *infoPtr = (FileState *) instanceData; - int oldMask = infoPtr->watchMask; - ThreadSpecificData *tsdPtr; - - tsdPtr = FileInit(); + Tcl_Time blockTime = { 0, 0 }; infoPtr->watchMask = mask; if (infoPtr->watchMask) { - if (!oldMask) { - infoPtr->nextPtr = tsdPtr->firstFilePtr; - tsdPtr->firstFilePtr = infoPtr; - } - } else { - if (oldMask) { - /* - * Remove the file from the list of watched files. - */ - - for (nextPtrPtr = &(tsdPtr->firstFilePtr), ptr = *nextPtrPtr; - ptr != NULL; - nextPtrPtr = &ptr->nextPtr, ptr = *nextPtrPtr) { - if (infoPtr == ptr) { - *nextPtrPtr = ptr->nextPtr; - break; - } - } - } + Tcl_SetMaxBlockTime(&blockTime); } } |