From f1ba4fb2e7772597ca11e581c452d83ee75efd8d Mon Sep 17 00:00:00 2001 From: John Ankarstrom Date: Fri, 2 Jul 2021 19:13:05 +0200 Subject: xchord: Use vfork + exec instead of system --- xchord.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/xchord.c b/xchord.c index 59d3f52..ff1c755 100644 --- a/xchord.c +++ b/xchord.c @@ -16,6 +16,7 @@ * xchord is written by John Ankarström . */ +#include #include #include #include @@ -85,7 +86,10 @@ main(int argc, char *argv[]) /* button 1 released */ if (rev->detail == 1) p1 = 0; /* button 1 pressed + 3 released */ - if (p1 && rev->detail == 3) system("dwim"); + if (p1 && rev->detail == 3 && vfork() == 0) { + execlp("dwim", "dwim", NULL); + err(1, "execlp"); + } break; } -- cgit v1.2.3