--- src/os.c +++ src/os.c @@ -793,9 +793,10 @@ #if OS_UNIX static const char *azDirs[] = { 0, + 0, + "/tmp", "/var/tmp", "/usr/tmp", - "/tmp", ".", }; static unsigned char zChars[] = @@ -806,6 +807,7 @@ struct stat buf; const char *zDir = "."; azDirs[0] = sqlite_temp_directory; + azDirs[1] = getenv("TMPDIR"); for(i=0; i