From f4aa774c4b15e237b2832e2fe196cbb311b9843e Mon Sep 17 00:00:00 2001 From: Andre Noll Date: Wed, 1 Jan 2025 21:39:34 +0100 Subject: [PATCH] Kill BINDIR. When executing para_client or para_audioc from para_mixer or para_gui we currently pass an absolute path whose directory part is BINDIR to execvp(2). This is unnecessary because execvp(2) honors $PATH. This commit modifies gui.c and mixer.c to pass only the basename of the executable instead, allowing us to remove the BINDIR preprocessor define. We still need the bindir make variable, though, because it is referenced in the recipe of the two install targets. --- Makefile.real | 1 - gui.c | 4 +--- mixer.c | 4 ++-- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/Makefile.real b/Makefile.real index 19f4c232..a5492d66 100644 --- a/Makefile.real +++ b/Makefile.real @@ -357,7 +357,6 @@ $(object_dir) $(man_dir) $(dep_dir) $(m4depdir) $(lls_suite_dir) \ $(yy_build_dir): @$(MKDIR_P) $@ -CPPFLAGS += -DBINDIR='"$(bindir)"' CPPFLAGS += -DCOPYRIGHT_YEAR='"$(COPYRIGHT_YEAR)"' CPPFLAGS += -DBUILD_DATE='"$(build_date)"' CPPFLAGS += -DLOGLEVELS='$(LOGLEVELS)' diff --git a/gui.c b/gui.c index 2ad8ae46..feb65c0f 100644 --- a/gui.c +++ b/gui.c @@ -1027,9 +1027,7 @@ fail: static void exec_para(const char *args) { - char *file_and_args; - - file_and_args = make_message(BINDIR "/para_client -- %s", args); + char *file_and_args = make_message("para_client -- %s", args); exec_and_display(file_and_args); free(file_and_args); } diff --git a/mixer.c b/mixer.c index dda7fc1d..787a7257 100644 --- a/mixer.c +++ b/mixer.c @@ -217,12 +217,12 @@ fail: static void client_cmd(const char *cmd) { - run(BINDIR "/para_client", cmd); + run("para_client", cmd); } static void audioc_cmd(const char *cmd) { - run(BINDIR "/para_audioc", cmd); + run("para_audioc", cmd); } static void change_afs_mode(const char *afs_mode) -- 2.39.5