summaryrefslogtreecommitdiff
path: root/src/irmd
diff options
context:
space:
mode:
authordimitri staessens <dimitri.staessens@ugent.be>2017-09-18 07:39:47 +0000
committerSander Vrijders <sander.vrijders@ugent.be>2017-09-18 07:39:47 +0000
commitbf52441ac2844b3e2517a5c98e110f32372f0876 (patch)
tree73bc28244ef03c23e2ba5e79ae843de3df3fe727 /src/irmd
parent60ffacc12ab73752cb6ef736f2b41022c984785c (diff)
parentf86502516b2a069954d0529d8b43593ece7360eb (diff)
downloadouroboros-bf52441ac2844b3e2517a5c98e110f32372f0876.tar.gz
ouroboros-bf52441ac2844b3e2517a5c98e110f32372f0876.zip
Merged in dstaesse/ouroboros/be-fuse (pull request #594)
lib: Provide RIB API to export internals via fuse
Diffstat (limited to 'src/irmd')
-rw-r--r--src/irmd/config.h.in5
-rw-r--r--src/irmd/main.c12
2 files changed, 16 insertions, 1 deletions
diff --git a/src/irmd/config.h.in b/src/irmd/config.h.in
index c217fe93..d253a1ac 100644
--- a/src/irmd/config.h.in
+++ b/src/irmd/config.h.in
@@ -45,3 +45,8 @@
#define IRMD_MIN_THREADS @IRMD_MIN_THREADS@
#define IRMD_ADD_THREADS @IRMD_ADD_THREADS@
+
+#cmakedefine HAVE_FUSE
+#ifdef HAVE_FUSE
+#define FUSE_PREFIX "@FUSE_PREFIX@"
+#endif
diff --git a/src/irmd/main.c b/src/irmd/main.c
index c5caff6c..df903f40 100644
--- a/src/irmd/main.c
+++ b/src/irmd/main.c
@@ -1631,6 +1631,11 @@ static void irm_fini(void)
pthread_cond_destroy(&irmd.cmd_cond);
pthread_rwlock_destroy(&irmd.reg_lock);
pthread_rwlock_destroy(&irmd.state_lock);
+
+#ifdef HAVE_FUSE
+ if (rmdir(FUSE_PREFIX))
+ log_dbg("Failed to remove " FUSE_PREFIX);
+#endif
}
void irmd_sig_handler(int sig,
@@ -2249,7 +2254,12 @@ static int irm_init(void)
log_err("Failed to create rdrbuff.");
goto fail_rdrbuff;
}
-
+#ifdef HAVE_FUSE
+ if (stat(FUSE_PREFIX, &st) != -1)
+ log_warn(FUSE_PREFIX " already exists...");
+ else
+ mkdir(FUSE_PREFIX, 0777);
+#endif
irmd.csockfd = -1;
irmd.state = IRMD_RUNNING;