From 8f0f9765065901d39650a0f204dda8f4687155f5 Mon Sep 17 00:00:00 2001 From: hobbs Date: Wed, 19 Feb 2003 01:05:27 +0000 Subject: * unix/tclUnixThrd.c (TclpReaddir): reduce size of name string in tsd to NAME_MAX instead of PATH_MAX. [Bug #689100] (waters) --- ChangeLog | 9 ++++++++- unix/tclUnixThrd.c | 6 ++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 504988f..65a1dcc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2003-02-18 Jeff Hobbs + + * generic/tclIO.c (HaveVersion): correctly decl static + + * unix/tclUnixThrd.c (TclpReaddir): reduce size of name string in + tsd to NAME_MAX instead of PATH_MAX. [Bug #689100] (waters) + 2003-02-18 Mo DeJong * unix/configure: Regen. @@ -9,7 +16,7 @@ * generic/tclTest.c: cleanup of new 'simplefs' test code, and better documentation. - + 2003-02-17 Miguel Sofer * generic/tclBasic.c (TclRenameCommand): fixing error in previous diff --git a/unix/tclUnixThrd.c b/unix/tclUnixThrd.c index 1dd2d99..28267f4 100644 --- a/unix/tclUnixThrd.c +++ b/unix/tclUnixThrd.c @@ -25,7 +25,9 @@ typedef struct ThreadSpecificData { struct tm ltbuf; struct { Tcl_DirEntry ent; - char name[PATH_MAX+1]; +#ifdef NAME_MAX /* if not, dirent *better* have room for name */ + char name[NAME_MAX+1]; +#endif } rdbuf; } ThreadSpecificData; @@ -819,7 +821,7 @@ TclpReaddir(DIR * dir) # endif /* HAVE_STRUCT_DIRENT64 */ if (ent != NULL) { memcpy((VOID *) &tsdPtr->rdbuf.ent, (VOID *) ent, - sizeof(Tcl_DirEntry) + sizeof(char) * (PATH_MAX+1)); + sizeof(&tsdPtr->rdbuf)); ent = &tsdPtr->rdbuf.ent; } Tcl_MutexUnlock(&rdMutex); -- cgit v0.12