diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | unix/tclUnixFCmd.c | 4 |
2 files changed, 7 insertions, 2 deletions
@@ -1,3 +1,8 @@ +2013-05-20 Donal K. Fellows <dkf@users.sf.net> + + * unix/tclUnixFCmd.c (DefaultTempDir): [Bug 3613567]: Corrected logic + for checking return code of access() system call, which was inverted. + 2013-05-19 Jan Nijtmans <nijtmans@users.sf.net> * unix/tcl.m4: Fix for FreeBSD, and remove support for older 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 |