diff options
author | dgp <dgp@users.sourceforge.net> | 2018-05-08 15:00:40 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2018-05-08 15:00:40 (GMT) |
commit | 7f26fedbccc3c9f7908417c0abe1cceae115a237 (patch) | |
tree | f7d5730eb82f0c65685199459df425f653924f8f /unix | |
parent | 1f71d7079b597878c3312bb94811772cb708e3f8 (diff) | |
parent | 47e9dbdc37939a6e874afd15d6586864649f23c7 (diff) | |
download | tcl-7f26fedbccc3c9f7908417c0abe1cceae115a237.zip tcl-7f26fedbccc3c9f7908417c0abe1cceae115a237.tar.gz tcl-7f26fedbccc3c9f7908417c0abe1cceae115a237.tar.bz2 |
merge 8.6
Diffstat (limited to 'unix')
-rw-r--r-- | unix/tclUnixFCmd.c | 14 | ||||
-rw-r--r-- | unix/tclUnixFile.c | 4 | ||||
-rw-r--r-- | unix/tclUnixPort.h | 6 |
3 files changed, 15 insertions, 9 deletions
diff --git a/unix/tclUnixFCmd.c b/unix/tclUnixFCmd.c index e156f77..7250e87 100644 --- a/unix/tclUnixFCmd.c +++ b/unix/tclUnixFCmd.c @@ -375,7 +375,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. */ @@ -385,11 +385,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; @@ -990,7 +990,7 @@ TraverseUnixTree( errorPtr); } #ifndef HAVE_FTS - dirPtr = opendir(source); /* INTL: Native. */ + dirPtr = TclOSopendir(source); /* INTL: Native. */ if (dirPtr == NULL) { /* * Can't read directory @@ -1002,7 +1002,7 @@ TraverseUnixTree( result = traverseProc(sourcePtr, targetPtr, &statBuf, DOTREE_PRED, errorPtr); if (result != TCL_OK) { - closedir(dirPtr); + TclOSclosedir(dirPtr); return result; } @@ -1052,11 +1052,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 diff --git a/unix/tclUnixFile.c b/unix/tclUnixFile.c index 5f5bfe0..5215bdf 100644 --- a/unix/tclUnixFile.c +++ b/unix/tclUnixFile.c @@ -310,7 +310,7 @@ TclpMatchInDirectory( return TCL_OK; } - d = opendir(native); /* INTL: Native. */ + d = TclOSopendir(native); /* INTL: Native. */ if (d == NULL) { Tcl_DStringFree(&ds); if (interp != NULL) { @@ -388,7 +388,7 @@ TclpMatchInDirectory( } } - closedir(d); + TclOSclosedir(d); Tcl_DStringFree(&ds); Tcl_DStringFree(&dsOrig); Tcl_DecrRefCount(fileNamePtr); diff --git a/unix/tclUnixPort.h b/unix/tclUnixPort.h index 86f1dd0..8e71b3a 100644 --- a/unix/tclUnixPort.h +++ b/unix/tclUnixPort.h @@ -59,9 +59,15 @@ #ifdef HAVE_STRUCT_DIRENT64 typedef struct dirent64 Tcl_DirEntry; # define TclOSreaddir readdir64 +# define TclOSopendir opendir64 +# define TclOSrewinddir rewinddir64 +# define TclOSclosedir closedir64 #else typedef struct dirent Tcl_DirEntry; # define TclOSreaddir readdir +# define TclOSopendir opendir +# define TclOSrewinddir rewinddir +# define TclOSclosedir closedir #endif #ifdef HAVE_TYPE_OFF64_T |