[PATCH] Use unique display name for each xi2 test program [v2]

Alan Coopersmith alan.coopersmith at oracle.com
Thu Oct 2 17:17:26 PDT 2014


On 10/ 2/14 05:08 PM, Keith Packard wrote:
> From: Alan Coopersmith <alan.coopersmith at oracle.com>
>
> make -j 8 check was sporadically failing in different xi2 tests.
> After adding the asserts in the previous commit to catch xkb failure
> it became easier to catch the failures and see that multiple tests
> were running at once trying to write to /tmp/server-(null).xkm and
> then delete it, and interfering with each other.
>
> Putting a unique string into the display variable let them each write
> to their own file and not interfere with others.
>
> v2: Fix Linux bits:
>
>    Add #include <errno.h> to get a declaration of
>    program_invocation_name on Linux.
>
>    Use only the last portion of the pathname so that the resulting
>    display name doesn't contain any slashes.

http://man7.org/linux/man-pages/man3/program_invocation_name.3.html
suggests that simply using program_invocation_short_name instead takes
care of reducing to the basename for you.   (As getprogname() does on
Solaris & BSD.)

Otherwise, whatever works for you on Linux is fine with me.

-- 
	-Alan Coopersmith-              alan.coopersmith at oracle.com
	 Oracle Solaris Engineering - http://blogs.oracle.com/alanc


More information about the xorg-devel mailing list