diff options
author | sebres <sebres@users.sourceforge.net> | 2018-05-08 09:49:16 (GMT) |
---|---|---|
committer | sebres <sebres@users.sourceforge.net> | 2018-05-08 09:49:16 (GMT) |
commit | 78ee8c697e423a5b4718fabb53eef1c5f6a2a2b1 (patch) | |
tree | 56621e264162af5c4f27a4b99f134cee38f73223 /unix/tclUnixFCmd.c | |
parent | 0fc27b893e12027a6b5136fb96ba216b823f43e1 (diff) | |
download | tcl-78ee8c697e423a5b4718fabb53eef1c5f6a2a2b1.zip tcl-78ee8c697e423a5b4718fabb53eef1c5f6a2a2b1.tar.gz tcl-78ee8c697e423a5b4718fabb53eef1c5f6a2a2b1.tar.bz2 |
fixes [92564326a98b5510]: wrong x64-aligned handle from readdir64 by opendir/rewinddir/closedir, if HAVE_STRUCT_DIRENT64 used.
Diffstat (limited to 'unix/tclUnixFCmd.c')
-rw-r--r-- | unix/tclUnixFCmd.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/unix/tclUnixFCmd.c b/unix/tclUnixFCmd.c index b5450b1..4377b77 100644 --- a/unix/tclUnixFCmd.c +++ b/unix/tclUnixFCmd.c @@ -333,7 +333,7 @@ DoRenameFile( if ((Realpath((char *) src, srcPath) != NULL) /* INTL: Native. */ && (Realpath((char *) dst, dstPath) != NULL) /* INTL: Native */ && (strncmp(srcPath, dstPath, strlen(srcPath)) != 0)) { - dirPtr = opendir(dst); /* INTL: Native. */ + dirPtr = TclOSopendir(dst); /* INTL: Native. */ if (dirPtr != NULL) { while (1) { dirEntPtr = TclOSreaddir(dirPtr); /* INTL: Native. */ @@ -343,11 +343,11 @@ DoRenameFile( if ((strcmp(dirEntPtr->d_name, ".") != 0) && (strcmp(dirEntPtr->d_name, "..") != 0)) { errno = EEXIST; - closedir(dirPtr); + TclOSclosedir(dirPtr); return TCL_ERROR; } } - closedir(dirPtr); + TclOSclosedir(dirPtr); } } errno = EINVAL; @@ -945,7 +945,7 @@ TraverseUnixTree( errorPtr); } #ifndef HAVE_FTS - dirPtr = opendir(source); /* INTL: Native. */ + dirPtr = TclOSopendir(source); /* INTL: Native. */ if (dirPtr == NULL) { /* * Can't read directory @@ -957,7 +957,7 @@ TraverseUnixTree( result = (*traverseProc)(sourcePtr, targetPtr, &statBuf, DOTREE_PRED, errorPtr); if (result != TCL_OK) { - closedir(dirPtr); + TclOSclosedir(dirPtr); return result; } @@ -1007,11 +1007,11 @@ TraverseUnixTree( * NULL-return that may a symptom of a buggy readdir. */ - rewinddir(dirPtr); + TclOSrewinddir(dirPtr); numProcessed = 0; } } - closedir(dirPtr); + TclOSclosedir(dirPtr); /* * Strip off the trailing slash we added |