mirror of
https://gitlab.freedesktop.org/wayland/wayland.git
synced 2025-10-29 05:40:16 -04:00
tests: Use unique XDG_RUNTIME_DIR
Rather than using a hardcoded 'wayland-tests' directory under the existing XDG_RUNTIME_DIR to use as the new runtime dir, use mkdtemp to guarantee uniqueness. This fixes make -jN check, as well as just happening to run 'make check' twice from the same session. Signed-off-by: Daniel Stone <daniels@collabora.com> Reported-by: Pekka Paalanen <pekka.paalanen@collabora.com> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk> Tested-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
This commit is contained in:
parent
b802108f6e
commit
23d3c67c9a
1 changed files with 2 additions and 1 deletions
|
|
@ -226,10 +226,11 @@ set_xdg_runtime_dir(void)
|
|||
|
||||
xrd_env = getenv("XDG_RUNTIME_DIR");
|
||||
/* if XDG_RUNTIME_DIR is not set in environ, fallback to /tmp */
|
||||
assert((snprintf(xdg_runtime_dir, PATH_MAX, "%s/wayland-tests",
|
||||
assert((snprintf(xdg_runtime_dir, PATH_MAX, "%s/wayland-tests-XXXXXX",
|
||||
xrd_env ? xrd_env : "/tmp") < PATH_MAX)
|
||||
&& "test error: XDG_RUNTIME_DIR too long");
|
||||
|
||||
assert(mkdtemp(xdg_runtime_dir) && "test error: mkdtemp failed");
|
||||
if (mkdir(xdg_runtime_dir, 0700) == -1)
|
||||
if (errno != EEXIST) {
|
||||
perror("Creating XDG_RUNTIME_DIR");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue