summaryrefslogtreecommitdiffstats
path: root/unix/tclUnixThrd.c
diff options
context:
space:
mode:
authorjenglish <jenglish@flightlab.com>2005-01-09 19:31:35 (GMT)
committerjenglish <jenglish@flightlab.com>2005-01-09 19:31:35 (GMT)
commit0fd0a940d0f30779874e35c4c7838a11f7aea0a3 (patch)
tree137434cf38ca7522222e6473339b0a4d701b6a93 /unix/tclUnixThrd.c
parent1710976abe1deba276cdd00851965d411927f959 (diff)
downloadtcl-0fd0a940d0f30779874e35c4c7838a11f7aea0a3.zip
tcl-0fd0a940d0f30779874e35c4c7838a11f7aea0a3.tar.gz
tcl-0fd0a940d0f30779874e35c4c7838a11f7aea0a3.tar.bz2
Remove readdir_r() and related #ifdeffery (see #1095909).
Don't check for HAVE_READDIR_R. Regenerated configure script.
Diffstat (limited to 'unix/tclUnixThrd.c')
-rw-r--r--unix/tclUnixThrd.c52
1 files changed, 5 insertions, 47 deletions
diff --git a/unix/tclUnixThrd.c b/unix/tclUnixThrd.c
index 17130a7..7ce2bfa 100644
--- a/unix/tclUnixThrd.c
+++ b/unix/tclUnixThrd.c
@@ -20,10 +20,6 @@
typedef struct ThreadSpecificData {
char nabuf[16];
- struct {
- Tcl_DirEntry ent;
- char name[MAXNAMLEN+1];
- } rdbuf;
} ThreadSpecificData;
static Tcl_ThreadDataKey dataKey;
@@ -867,56 +863,18 @@ TclpFinalizeCondition(condPtr)
* Side effects:
* See documentation of C functions.
*
+ * Notes:
+ * TclpReaddir is no longer used by the core (see 1095909),
+ * but it appears in the internal stubs table (see #589526).
*----------------------------------------------------------------------
*/
-#if defined(TCL_THREADS) && !defined(HAVE_READDIR_R)
-TCL_DECLARE_MUTEX( rdMutex )
-#undef readdir
-#endif
-
Tcl_DirEntry *
TclpReaddir(DIR * dir)
{
- Tcl_DirEntry *ent;
-#ifdef TCL_THREADS
- ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey);
-
-#ifdef HAVE_READDIR_R
- 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;
- }
-
-#else /* !HAVE_READDIR_R */
-
- Tcl_MutexLock(&rdMutex);
-# ifdef HAVE_STRUCT_DIRENT64
- ent = readdir64(dir);
-# else /* !HAVE_STRUCT_DIRENT64 */
- ent = readdir(dir);
-# endif /* HAVE_STRUCT_DIRENT64 */
- if (ent != NULL) {
- memcpy((VOID *) &tsdPtr->rdbuf.ent, (VOID *) ent,
- sizeof(tsdPtr->rdbuf));
- ent = &tsdPtr->rdbuf.ent;
- }
- Tcl_MutexUnlock(&rdMutex);
-
-#endif /* HAVE_READDIR_R */
-#else
-# ifdef HAVE_STRUCT_DIRENT64
- ent = readdir64(dir);
-# else /* !HAVE_STRUCT_DIRENT64 */
- ent = readdir(dir);
-# endif /* HAVE_STRUCT_DIRENT64 */
-#endif
- return ent;
+ return TclOSreaddir(dir);
}
+
char *
TclpInetNtoa(struct in_addr addr)
{