mirror of
https://github.com/postgres/postgres.git
synced 2026-04-15 22:10:45 -04:00
pg_regress: Observe TMPDIR
Put the temporary socket directory under TMPDIR, if that environment variable is set, instead of the hardcoded /tmp. This allows running the tests if there is no /tmp at all (for example on Windows, although running the tests with Unix-domain sockets is not enabled on Windows yet). We also use TMPDIR everywhere else /tmp is hardcoded, so this makes the behavior consistent. Reviewed-by: Andrew Dunstan <andrew.dunstan@2ndquadrant.com> Discussion: https://www.postgresql.org/message-id/flat/54bde68c-d134-4eb8-5bd3-8af33b72a010@2ndquadrant.com
This commit is contained in:
parent
b79911dc8c
commit
9cedb16660
1 changed files with 2 additions and 1 deletions
|
|
@ -330,7 +330,8 @@ signal_remove_temp(int signum)
|
|||
static const char *
|
||||
make_temp_sockdir(void)
|
||||
{
|
||||
char *template = pg_strdup("/tmp/pg_regress-XXXXXX");
|
||||
char *template = psprintf("%s/pg_regress-XXXXXX",
|
||||
getenv("TMPDIR") ? getenv("TMPDIR") : "/tmp");
|
||||
|
||||
temp_sockdir = mkdtemp(template);
|
||||
if (temp_sockdir == NULL)
|
||||
|
|
|
|||
Loading…
Reference in a new issue