summaryrefslogtreecommitdiffstats
path: root/unix/tclUnixThrd.c
diff options
context:
space:
mode:
authorhobbs <hobbs>2005-07-08 01:06:05 (GMT)
committerhobbs <hobbs>2005-07-08 01:06:05 (GMT)
commitc7cbce40a31cd045bd4d15ebf401f13f6172ab2b (patch)
treeef6cbd99c219ed45f554068074278d1882b2ee1a /unix/tclUnixThrd.c
parentb70197afbdb6e71461ae861830db8f544fc47505 (diff)
downloadtcl-c7cbce40a31cd045bd4d15ebf401f13f6172ab2b.zip
tcl-c7cbce40a31cd045bd4d15ebf401f13f6172ab2b.tar.gz
tcl-c7cbce40a31cd045bd4d15ebf401f13f6172ab2b.tar.bz2
* unix/tcl.m4, unix/configure: Backported [Bug 1095909], removing
* unix/tclUnixPort.h: any use of readdir_r as it is not * unix/tclUnixThrd.c: necessary and just confuses things.
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 bdac40d..30b1fc6 100644
--- a/unix/tclUnixThrd.c
+++ b/unix/tclUnixThrd.c
@@ -21,10 +21,6 @@
typedef struct ThreadSpecificData {
char nabuf[16];
- struct {
- Tcl_DirEntry ent;
- char name[MAXNAMLEN+1];
- } rdbuf;
} ThreadSpecificData;
static Tcl_ThreadDataKey dataKey;
@@ -819,56 +815,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)
{