From 37535bd29190d013274f4ee100e105ccfd3ace11 Mon Sep 17 00:00:00 2001 From: Dimitri Staessens Date: Fri, 24 Mar 2023 12:55:37 +0100 Subject: irmd: Use CMAKE_INSTALL_SBINDIR to spawn IPCPs The "/sbin/" was hard-coded, which will fail if the installation SBIN directory is configured to something else. Signed-off-by: Dimitri Staessens Signed-off-by: Sander Vrijders --- src/irmd/ipcp.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'src/irmd/ipcp.c') diff --git a/src/irmd/ipcp.c b/src/irmd/ipcp.c index 360934b0..eeda1fbc 100644 --- a/src/irmd/ipcp.c +++ b/src/irmd/ipcp.c @@ -125,9 +125,8 @@ ipcp_msg_t * send_recv_ipcp_msg(pid_t pid, pid_t ipcp_create(const char * name, enum ipcp_type ipcp_type) { - pid_t pid = -1; - char * ipcp_dir = "/sbin/"; - char * exec_name = NULL; + pid_t pid; + char * exec_name; char irmd_pid[10]; char full_name[256]; char * argv[5]; @@ -162,8 +161,7 @@ pid_t ipcp_create(const char * name, sprintf(irmd_pid, "%u", getpid()); - strcpy(full_name, INSTALL_PREFIX); - strcat(full_name, ipcp_dir); + strcpy(full_name, INSTALL_PREFIX"/"INSTALL_SBINDIR"/"); strcat(full_name, exec_name); /* log_file to be placed at the end */ -- cgit v1.2.3