summaryrefslogtreecommitdiffstats
path: root/unix/tclUnixThrd.c
diff options
context:
space:
mode:
Diffstat (limited to 'unix/tclUnixThrd.c')
-rw-r--r--unix/tclUnixThrd.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/unix/tclUnixThrd.c b/unix/tclUnixThrd.c
index 00059df..ee080ba 100644
--- a/unix/tclUnixThrd.c
+++ b/unix/tclUnixThrd.c
@@ -835,8 +835,12 @@ TclpReaddir(DIR * dir)
ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey);
#ifdef HAVE_READDIR_R
- ent = &tsdPtr->rdbuf.ent;
+ ent = &tsdPtr->rdbuf.ent;
+# ifdef HAVE_TWO_ARG_READDIR_R
+ if (TclOSreaddir_r(dir, ent) != 0) {
+# else /* HAVE_THREE_ARG_READDIR_R */
if (TclOSreaddir_r(dir, ent, &ent) != 0) {
+# endif /* HAVE_TWO_ARG_READDIR_R */
ent = NULL;
}