git.postgresql.org Git - postgresql.git/commitdiff

git projects / postgresql.git / commitdiff
? search:
summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: b79911d)
pg_regress: Observe TMPDIR
2020年3月29日 07:25:40 +0000 (09:25 +0200)
2020年3月29日 07:25:40 +0000 (09:25 +0200)
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


diff --git a/src/test/regress/pg_regress.c b/src/test/regress/pg_regress.c
index 6bc19b9668dcc4dd53650a1c8c0d49c1b65dd1bd..1e2aa4865474d5b9fe7d15ba1129f2fca8c67c10 100644 (file)
--- a/src/test/regress/pg_regress.c
+++ b/src/test/regress/pg_regress.c
@@ -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)
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /