mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-12-01 08:03:31 +01:00
Merge remote-tracking branch 'origin/maint-0.2.2'
This commit is contained in:
commit
85ac832a14
4
changes/win_tmp_dir
Normal file
4
changes/win_tmp_dir
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
o Unit tests:
|
||||||
|
- Use GetTempDir to find the proper temporary directory location on
|
||||||
|
Windows when generating temporary files for the unit tests. Patch
|
||||||
|
by Gisle Vanem.
|
@ -84,10 +84,16 @@ setup_directory(void)
|
|||||||
if (is_setup) return;
|
if (is_setup) return;
|
||||||
|
|
||||||
#ifdef MS_WINDOWS
|
#ifdef MS_WINDOWS
|
||||||
// XXXX
|
{
|
||||||
tor_snprintf(temp_dir, sizeof(temp_dir),
|
char buf[MAX_PATH];
|
||||||
"c:\\windows\\temp\\tor_test_%d", (int)getpid());
|
const char *tmp = buf;
|
||||||
r = mkdir(temp_dir);
|
/* If this fails, we're probably screwed anyway */
|
||||||
|
if (!GetTempPath(sizeof(buf),buf))
|
||||||
|
tmp = "c:\\windows\\temp";
|
||||||
|
tor_snprintf(temp_dir, sizeof(temp_dir),
|
||||||
|
"%s\\tor_test_%d", tmp, (int)getpid());
|
||||||
|
r = mkdir(temp_dir);
|
||||||
|
}
|
||||||
#else
|
#else
|
||||||
tor_snprintf(temp_dir, sizeof(temp_dir), "/tmp/tor_test_%d", (int) getpid());
|
tor_snprintf(temp_dir, sizeof(temp_dir), "/tmp/tor_test_%d", (int) getpid());
|
||||||
r = mkdir(temp_dir, 0700);
|
r = mkdir(temp_dir, 0700);
|
||||||
|
Loading…
Reference in New Issue
Block a user