diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2018-03-08 16:35:55 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2018-03-08 16:35:55 +0000 |
commit | a5b808650c78dea42009435e612cddf8cbcd95ef (patch) | |
tree | c137dceaca447e09a4084ea6ba5427dfc3fb8a5a /src/lua/lua_common.c | |
parent | aeb018c0587c453c7a5c40259699eb34613d1d5d (diff) | |
download | rspamd-a5b808650c78dea42009435e612cddf8cbcd95ef.tar.gz rspamd-a5b808650c78dea42009435e612cddf8cbcd95ef.zip |
[Minor] Fix lua path on OSX
Diffstat (limited to 'src/lua/lua_common.c')
-rw-r--r-- | src/lua/lua_common.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/lua/lua_common.c b/src/lua/lua_common.c index f77fe6b6e..b44931682 100644 --- a/src/lua/lua_common.c +++ b/src/lua/lua_common.c @@ -215,6 +215,12 @@ lua_add_actions_global (lua_State *L) lua_setglobal (L, "rspamd_actions"); } +#ifndef __APPLE__ +#define OS_SO_SUFFIX ".so" +#else +#define OS_SO_SUFFIX ".dylib" +#endif + void rspamd_lua_set_path (lua_State *L, const ucl_object_t *cfg_obj, GHashTable *vars) { @@ -335,10 +341,12 @@ rspamd_lua_set_path (lua_State *L, const ucl_object_t *cfg_obj, GHashTable *vars lua_getfield (L, -1, "cpath"); old_path = luaL_checkstring (L, -1); + rspamd_snprintf (path_buf, sizeof (path_buf), - "%s/?.so;" + "%s/?%s;" "%s", libdir, + OS_SO_SUFFIX, old_path); lua_pop (L, 1); lua_pushstring (L, path_buf); |