Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 9cedb16

Browse files
committed
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
1 parent b79911d commit 9cedb16

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/test/regress/pg_regress.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,8 @@ signal_remove_temp(int signum)
330330
static const char *
331331
make_temp_sockdir(void)
332332
{
333-
char *template = pg_strdup("/tmp/pg_regress-XXXXXX");
333+
char *template = psprintf("%s/pg_regress-XXXXXX",
334+
getenv("TMPDIR") ? getenv("TMPDIR") : "/tmp");
334335

335336
temp_sockdir = mkdtemp(template);
336337
if (temp_sockdir == NULL)

0 commit comments

Comments
 (0)