From effb33b079561dbc4c3dce1f92f78bb618fbbbc9 Mon Sep 17 00:00:00 2001 From: hobbs Date: Thu, 20 Feb 2003 00:34:07 +0000 Subject: * unix/tclUnixThrd.c (TclpReaddir): * unix/tclUnixPort.h: update to Bug 689100 patch to ensure that there is a defined value of MAXNAMLEN (aka NAME_MAX in POSIX) and that we have some buffer allocated. --- ChangeLog | 7 +++++++ unix/tclUnixPort.h | 12 ++++++++++-- unix/tclUnixThrd.c | 4 +--- 3 files changed, 18 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 00e3872..b0c1eca 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2003-02-19 Jeff Hobbs + + * unix/tclUnixThrd.c (TclpReaddir): + * unix/tclUnixPort.h: update to Bug 689100 patch to ensure that + there is a defined value of MAXNAMLEN (aka NAME_MAX in POSIX) and + that we have some buffer allocated. + 2003-02-19 Daniel Steffen * generic/tclStringObj.c: restored Tcl_SetObjLength() side-effect diff --git a/unix/tclUnixPort.h b/unix/tclUnixPort.h index ef39fc5..511e09b 100644 --- a/unix/tclUnixPort.h +++ b/unix/tclUnixPort.h @@ -19,7 +19,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclUnixPort.h,v 1.26 2002/06/28 09:56:54 dkf Exp $ + * RCS: @(#) $Id: tclUnixPort.h,v 1.27 2003/02/20 00:34:09 hobbs Exp $ */ #ifndef _TCLUNIXPORT @@ -386,7 +386,7 @@ EXTERN int gettimeofday _ANSI_ARGS_((struct timeval *tp, #endif /* !S_ISSOCK */ /* - * Make sure that MAXPATHLEN is defined. + * Make sure that MAXPATHLEN and MAXNAMLEN are defined. */ #ifndef MAXPATHLEN @@ -397,6 +397,14 @@ EXTERN int gettimeofday _ANSI_ARGS_((struct timeval *tp, # endif #endif +#ifndef MAXNAMLEN +# ifdef NAME_MAX +# define MAXNAMLEN NAME_MAX +# else +# define MAXNAMLEN 255 +# endif +#endif + /* * Make sure that L_tmpnam is defined. */ diff --git a/unix/tclUnixThrd.c b/unix/tclUnixThrd.c index 28267f4..ebfd322 100644 --- a/unix/tclUnixThrd.c +++ b/unix/tclUnixThrd.c @@ -25,9 +25,7 @@ typedef struct ThreadSpecificData { struct tm ltbuf; struct { Tcl_DirEntry ent; -#ifdef NAME_MAX /* if not, dirent *better* have room for name */ - char name[NAME_MAX+1]; -#endif + char name[MAXNAMLEN+1]; } rdbuf; } ThreadSpecificData; -- cgit v0.12