summary refs log tree commit diff
path: root/sysdeps/posix
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/posix')
-rw-r--r--sysdeps/posix/tempname.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sysdeps/posix/tempname.c b/sysdeps/posix/tempname.c
index c3dbf5278b..a89a73721f 100644
--- a/sysdeps/posix/tempname.c
+++ b/sysdeps/posix/tempname.c
@@ -71,7 +71,7 @@ __path_search (char *tmpl, size_t tmpl_len, const char *dir, const char *pfx,
       else
 	dir = NULL;
     }
-  if (dir != NULL)
+  if (dir == NULL)
     {
       if (direxists (P_tmpdir))
 	dir = P_tmpdir;