summaryrefslogtreecommitdiffstats
path: root/unix/tclUnixFCmd.c
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2013-05-20 14:17:06 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2013-05-20 14:17:06 (GMT)
commit648841a413df682da795865db714428f8f6e2d47 (patch)
treeae68a7200e4642710c6f9baaa55700958b00c760 /unix/tclUnixFCmd.c
parent276bcea418a3db186a49c67505c81e5c8cf84b7b (diff)
downloadtcl-648841a413df682da795865db714428f8f6e2d47.zip
tcl-648841a413df682da795865db714428f8f6e2d47.tar.gz
tcl-648841a413df682da795865db714428f8f6e2d47.tar.bz2
[3613567]: Corrected sense of test on results of access() in temp file creation.
Diffstat (limited to 'unix/tclUnixFCmd.c')
-rw-r--r--unix/tclUnixFCmd.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/unix/tclUnixFCmd.c b/unix/tclUnixFCmd.c
index 6f443a9..e27f78f 100644
--- a/unix/tclUnixFCmd.c
+++ b/unix/tclUnixFCmd.c
@@ -2226,13 +2226,13 @@ DefaultTempDir(void)
dir = getenv("TMPDIR");
if (dir && dir[0] && stat(dir, &buf) == 0 && S_ISDIR(buf.st_mode)
- && access(dir, W_OK)) {
+ && access(dir, W_OK) == 0) {
return dir;
}
#ifdef P_tmpdir
dir = P_tmpdir;
- if (stat(dir, &buf) == 0 && S_ISDIR(buf.st_mode) && access(dir, W_OK)) {
+ if (stat(dir, &buf)==0 && S_ISDIR(buf.st_mode) && access(dir, W_OK)==0) {
return dir;
}
#endif