]> git.ipfire.org Git - thirdparty/rrdtool-1.x.git/commitdiff
lua: don't include rrd_restore if it wasn't included (#901)
authorKarl Palsson <karlp@tweak.net.au>
Fri, 17 Aug 2018 07:51:40 +0000 (07:51 +0000)
committerTobias Oetiker <tobi@oetiker.ch>
Fri, 17 Aug 2018 07:51:40 +0000 (09:51 +0200)
The lua module compiles ok, but fails to load.

> rrd=require("rrd")
error loading module 'rrd' from file '/usr/lib/lua/rrd.so':
Error relocating /usr/lib/lua/rrd.so: rrd_restore: symbol not found
stack traceback:
[C]: ?
[C]: in function 'require'

Signed-off-by: Karl Palsson <karlp@etactica.com>
bindings/lua/rrdlua.c

index d5e54a2358719d4096a72e7f1305d123a2005522..da8cab7615e8173e24f789b1ce3029047bdd1205 100644 (file)
@@ -170,12 +170,14 @@ lua_rrd_resize (lua_State * L)
   return 0;
 }
 
+#ifdef HAVE_RRD_RESTORE
 static int
 lua_rrd_restore (lua_State * L)
 {
   rrd_common_call(L, "restore", rrd_restore);
   return 0;
 }
+#endif
 
 static int
 lua_rrd_tune (lua_State * L)
@@ -366,7 +368,9 @@ static const struct luaL_Reg rrd[] = {
 #endif
   {"last", lua_rrd_last},
   {"resize", lua_rrd_resize},
+#ifdef HAVE_RRD_RESTORE
   {"restore", lua_rrd_restore},
+#endif
   {"tune", lua_rrd_tune},
   {"update", lua_rrd_update},
   {"flushcached", lua_rrd_flushcached},