summaryrefslogtreecommitdiffstats
path: root/unix
diff options
context:
space:
mode:
Diffstat (limited to 'unix')
-rw-r--r--unix/tclUnixThrd.c6
1 files changed, 4 insertions, 2 deletions
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);