From d35a8bbda95e5e602a07a43dbc6fa0d5cc89eed0 Mon Sep 17 00:00:00 2001 From: Joachim Nilsson Date: Mon, 15 Jan 2018 15:07:24 +0100 Subject: [PATCH] Fix problem building external plugins The file plugin.h is installed to $prefix/include and used by external plugins. Therefore it must not include, or depend on, features set by the configure script in config.h Signed-off-by: Joachim Nilsson --- src/finit.c | 2 +- src/plugin.c | 4 ++-- src/plugin.h | 5 ----- src/private.h | 2 +- 4 files changed, 4 insertions(+), 9 deletions(-) diff --git a/src/finit.c b/src/finit.c index 0c9a9cf7..7397fd90 100644 --- a/src/finit.c +++ b/src/finit.c @@ -320,7 +320,7 @@ int main(int argc, char* argv[]) * Load plugins early, finit.conf may contain references to * features implemented by plugins. */ - plugin_init(&loop, PLUGIN_PATH); + plugin_init(&loop); /* * Hello world. diff --git a/src/plugin.c b/src/plugin.c index c05cd8a5..c2ef5b9d 100644 --- a/src/plugin.c +++ b/src/plugin.c @@ -382,11 +382,11 @@ static int load_plugins(char *path) } #endif /* ENABLE_STATIC */ -int plugin_init(uev_ctx_t *ctx, char *path) +int plugin_init(uev_ctx_t *ctx) { int fail = 1; - if (!load_plugins(path)) + if (!load_plugins(PLUGIN_PATH)) fail = init_plugins(ctx); return fail; diff --git a/src/plugin.h b/src/plugin.h index 92779179..ea85826d 100644 --- a/src/plugin.h +++ b/src/plugin.h @@ -24,16 +24,11 @@ #ifndef FINIT_PLUGIN_H_ #define FINIT_PLUGIN_H_ -#include #include #include /* BSD sys/queue.h API */ #include "svc.h" -#ifndef PLUGIN_PATH /* Fallback for --enable-static builds */ -#define PLUGIN_PATH "/dev/null" -#endif - #define PLUGIN_DEP_MAX 10 /* diff --git a/src/private.h b/src/private.h index 53c9659e..028f7381 100644 --- a/src/private.h +++ b/src/private.h @@ -45,7 +45,7 @@ int plugin_exists (hook_point_t no); void plugin_run_hook (hook_point_t no, void *arg); void plugin_run_hooks (hook_point_t no); -int plugin_init (uev_ctx_t *ctx, char *path); +int plugin_init (uev_ctx_t *ctx); void plugin_exit (void); #endif /* FINIT_PRIVATE_H_ */