aboutsummaryrefslogtreecommitdiffstats
path: root/util-src/pposix.c
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2013-04-08 17:22:15 +0100
committerMatthew Wild <mwild1@gmail.com>2013-04-08 17:22:15 +0100
commit94b629076096ad83c60c01af607d3aee160584b4 (patch)
treeb63f60f6dff8c647f5952a2a92bb0a1da8d2a94f /util-src/pposix.c
parent308088b1faaf9a50df3432378e0bc4be52b35ab3 (diff)
parent7e9a5cc5a36ae7d653836615143b5a78a505bfed (diff)
downloadprosody-94b629076096ad83c60c01af607d3aee160584b4.tar.gz
prosody-94b629076096ad83c60c01af607d3aee160584b4.zip
Merge 0.9->trunk
Diffstat (limited to 'util-src/pposix.c')
-rw-r--r--util-src/pposix.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/util-src/pposix.c b/util-src/pposix.c
index 99a308cf..f5cc8270 100644
--- a/util-src/pposix.c
+++ b/util-src/pposix.c
@@ -13,7 +13,7 @@
* POSIX support functions for Lua
*/
-#define MODULE_VERSION "0.3.5"
+#define MODULE_VERSION "0.3.6"
#include <stdlib.h>
#include <math.h>
@@ -204,12 +204,13 @@ int level_constants[] = {
};
int lc_syslog_log(lua_State* L)
{
- int level = luaL_checkoption(L, 1, "notice", level_strings);
- level = level_constants[level];
+ int level = level_constants[luaL_checkoption(L, 1, "notice", level_strings)];
- luaL_checkstring(L, 2);
+ if(lua_gettop(L) == 3)
+ syslog(level, "%s: %s", luaL_checkstring(L, 2), luaL_checkstring(L, 3));
+ else
+ syslog(level, "%s", lua_tostring(L, 2));
- syslog(level, "%s", lua_tostring(L, 2));
return 0;
}