From a1f426f464989d8d045435f1f396719d29bcbdb2 Mon Sep 17 00:00:00 2001 From: Dimitri Staessens Date: Tue, 15 May 2018 13:46:59 +0200 Subject: lib: Use IPCP name as RIB directory This will change the FUSE mountpount to the name of the IPCP instead of a generic name based on its pid. Signed-off-by: Dimitri Staessens Signed-off-by: Sander Vrijders --- src/ipcpd/normal/main.c | 2 +- src/lib/rib.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/ipcpd/normal/main.c b/src/ipcpd/normal/main.c index 152f7640..b131bbb6 100644 --- a/src/ipcpd/normal/main.c +++ b/src/ipcpd/normal/main.c @@ -304,7 +304,7 @@ int main(int argc, } /* These components must be init at creation. */ - if (rib_init("ipcpd-normal")) { + if (rib_init(ipcpi.name)) { log_err("Failed to initialize RIB."); goto fail_rib_init; } diff --git a/src/lib/rib.c b/src/lib/rib.c index fa525c50..22397e24 100644 --- a/src/lib/rib.c +++ b/src/lib/rib.c @@ -261,7 +261,7 @@ static void * fuse_thr(void * o) #endif /* HAVE_FUSE */ -int rib_init(const char * prefix) +int rib_init(const char * mountpt) { #ifdef HAVE_FUSE struct stat st; @@ -277,7 +277,7 @@ int rib_init(const char * prefix) if (stat(FUSE_PREFIX, &st) == -1) return -1; - sprintf(rib.mnt, FUSE_PREFIX "/%s.%d", prefix, getpid()); + sprintf(rib.mnt, FUSE_PREFIX "/%s", mountpt); if (stat(rib.mnt, &st) == -1) switch(errno) { -- cgit v1.2.3