X-Git-Url: https://git.enpas.org/?a=blobdiff_plain;f=prosody;h=a2cb0e6cdb09319aa1650d7b51f4597728947aab;hb=c86d0082f66bd65fb7bd4e9fc94fac401e256d0f;hp=e6a23d8e703f6fb172f188d45a6e87a089fde333;hpb=d7500b793dfcb85934bc5c42213dc6b393b1a2f6;p=prosody.git diff --git a/prosody b/prosody index e6a23d8e..a2cb0e6c 100755 --- a/prosody +++ b/prosody @@ -43,6 +43,12 @@ if CFG_DATADIR then end end +if #arg > 0 and arg[1] ~= "--config" then + print("Unknown command-line option: "..tostring(arg[1])); + print("Perhaps you meant to use prosodyctl instead?"); + return 1; +end + -- Global 'prosody' object local prosody = { events = require "util.events".new(); }; _G.prosody = prosody; @@ -121,6 +127,7 @@ end function load_libraries() -- Load socket framework + socket = require "socket"; server = require "net.server" end @@ -371,8 +378,10 @@ function loop() prosody.events.fire_event("very-bad-error", {error = err, traceback = traceback}); end + local sleep = require"socket".sleep; + while select(2, xpcall(server.loop, catch_uncaught_error)) ~= "quitting" do - socket.sleep(0.2); + sleep(0.2); end end