aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorWaqas Hussain <waqas20@gmail.com>2010-05-07 16:21:04 +0500
committerWaqas Hussain <waqas20@gmail.com>2010-05-07 16:21:04 +0500
commit896c6443c55ba89cc4a22063ab91c8f105a96149 (patch)
treedb9f4c42c3f51af2e4552ddb5de606d5cce19f35 /plugins
parent2f333716e6e6dcb12648ed8c8683d7189ead4efe (diff)
parentcfb093a9f4e464fba1e56c2e3e340ece4219a411 (diff)
downloadprosody-896c6443c55ba89cc4a22063ab91c8f105a96149.tar.gz
prosody-896c6443c55ba89cc4a22063ab91c8f105a96149.zip
Merge 0.7->trunk
Diffstat (limited to 'plugins')
-rw-r--r--plugins/mod_console.lua6
-rw-r--r--plugins/mod_posix.lua1
2 files changed, 5 insertions, 2 deletions
diff --git a/plugins/mod_console.lua b/plugins/mod_console.lua
index 4457a2f3..e87ef536 100644
--- a/plugins/mod_console.lua
+++ b/plugins/mod_console.lua
@@ -58,6 +58,7 @@ function console_listener.onconnect(conn)
local session = console:new_session(conn);
sessions[conn] = session;
printbanner(session);
+ session.send(string.char(0));
end
function console_listener.onincoming(conn, data)
@@ -84,9 +85,10 @@ function console_listener.onincoming(conn, data)
session.env._ = data;
- local chunk, err = loadstring("return "..data);
+ local chunkname = "=console";
+ local chunk, err = loadstring("return "..data, chunkname);
if not chunk then
- chunk, err = loadstring(data);
+ chunk, err = loadstring(data, chunkname);
if not chunk then
err = err:gsub("^%[string .-%]:%d+: ", "");
err = err:gsub("^:%d+: ", "");
diff --git a/plugins/mod_posix.lua b/plugins/mod_posix.lua
index 5e9d2544..52b1e0e6 100644
--- a/plugins/mod_posix.lua
+++ b/plugins/mod_posix.lua
@@ -82,6 +82,7 @@ local function write_pidfile()
end
pidfile = module:get_option("pidfile");
if pidfile then
+ local err;
local mode = stat(pidfile) and "r+" or "w+";
pidfile_handle, err = io.open(pidfile, mode);
if not pidfile_handle then