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

Lines changed: 2 additions & 1 deletion
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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy