summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDimitri Staessens <dimitri@ouroboros.rocks>2023-03-24 12:55:37 +0100
committerSander Vrijders <sander@ouroboros.rocks>2023-04-03 08:35:49 +0200
commit37535bd29190d013274f4ee100e105ccfd3ace11 (patch)
treed44428762b8694604974aa4e9fa83c1024e44ddb /src
parent51650a6dfcc0abc330200caf1ea89fcb6b8dce8b (diff)
downloadouroboros-37535bd29190d013274f4ee100e105ccfd3ace11.tar.gz
ouroboros-37535bd29190d013274f4ee100e105ccfd3ace11.zip
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 <dimitri@ouroboros.rocks> Signed-off-by: Sander Vrijders <sander@ouroboros.rocks>
Diffstat (limited to 'src')
-rw-r--r--src/irmd/config.h.in12
-rw-r--r--src/irmd/ipcp.c8
2 files changed, 10 insertions, 10 deletions
diff --git a/src/irmd/config.h.in b/src/irmd/config.h.in
index 10ccaa52..575d3123 100644
--- a/src/irmd/config.h.in
+++ b/src/irmd/config.h.in
@@ -20,6 +20,7 @@
* Foundation, Inc., http://www.fsf.org/about/contact/.
*/
+
#define IPCP_UDP_EXEC "@IPCP_UDP_TARGET@"
#define IPCP_ETH_LLC_EXEC "@IPCP_ETH_LLC_TARGET@"
#define IPCP_ETH_DIX_EXEC "@IPCP_ETH_DIX_TARGET@"
@@ -28,6 +29,7 @@
#define IPCP_LOCAL_EXEC "@IPCP_LOCAL_TARGET@"
#define INSTALL_PREFIX "@CMAKE_INSTALL_PREFIX@"
+#define INSTALL_SBINDIR "@CMAKE_INSTALL_SBINDIR@"
#define PTHREAD_COND_CLOCK @PTHREAD_COND_CLOCK@
@@ -47,15 +49,15 @@
#define IRMD_MIN_THREADS @IRMD_MIN_THREADS@
#define IRMD_ADD_THREADS @IRMD_ADD_THREADS@
-#define OUROBOROS_CONFIG_DIR "@OUROBOROS_CONFIG_DIR@"
-#define OUROBOROS_CONFIG_FILE "@OUROBOROS_CONFIG_FILE@"
-
#cmakedefine HAVE_FUSE
#ifdef HAVE_FUSE
#define FUSE_PREFIX "@FUSE_PREFIX@"
#endif
#cmakedefine HAVE_TOML
-#cmakedefine HAVE_CONFINI
-#cmakedefine OUROBOROS_CONFIG_INI
+#ifdef HAVE_TOML
+#define OUROBOROS_CONFIG_DIR "@OUROBOROS_CONFIG_DIR@"
+#define OUROBOROS_CONFIG_FILE "@OUROBOROS_CONFIG_FILE@"
+#endif
+
#cmakedefine HAVE_LIBGCRYPT
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 */