From 19f4abd00968795d20000d927af296bb1d8da519 Mon Sep 17 00:00:00 2001 From: Thomas Adam Date: Sun, 20 Dec 2020 14:31:51 +0000 Subject: [PATCH] FvwmMFL: make pid file slightly more unique When FvwmMFL learned to only start one instance of itself, the pid file used didn't contain any unique attribute. As such, trying to run fvwm3 with FvwmMFL under Xephyr meant that separate instance of FvwmMFL was never started. To fix this, embed the DISPLAY value to the pid filename to allow it to run more than once, albeit unique to each display. --- modules/FvwmMFL/FvwmMFL.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/modules/FvwmMFL/FvwmMFL.c b/modules/FvwmMFL/FvwmMFL.c index d325ebb40..c0b15df17 100644 --- a/modules/FvwmMFL/FvwmMFL.c +++ b/modules/FvwmMFL/FvwmMFL.c @@ -142,14 +142,16 @@ static void set_pid_file(void) { char *fud = getenv("FVWM_USERDIR"); + char *dsp = getenv("DISPLAY"); - if (fud == NULL) { - fprintf(stderr, "FVWM_USERDIR is not set in the environment\n"); + if (fud == NULL || dsp == NULL) { + fprintf(stderr, + "FVWM_USERDIR or DISPLAY is not set in the environment\n"); exit(1); } free(pid_file); - xasprintf(&pid_file, "%s/fvwm_mfl.pid", fud); + xasprintf(&pid_file, "%s/fvwm_mfl_%s.pid", fud, dsp); } static void