From 1e07ec7b4d232902530f3457e7237353a40262f6 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 3 Jul 2016 17:56:41 +0300 Subject: Add --run-once flag into login server. --- src/login/login.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src') diff --git a/src/login/login.c b/src/login/login.c index d7c7321d8..49508d564 100644 --- a/src/login/login.c +++ b/src/login/login.c @@ -1671,6 +1671,19 @@ static CMDLINEARG(loginconfig) login->LOGIN_CONF_NAME = aStrdup(params); return true; } + +/** + * --run-once handler + * + * Causes the server to run its loop once, and shutdown. Useful for testing. + * @see cmdline->exec + */ +static CMDLINEARG(runonce) +{ + core->runflag = CORE_ST_STOP; + return true; +} + /** * --net-config handler * @@ -1688,6 +1701,7 @@ static CMDLINEARG(netconfig) */ void cmdline_args_init_local(void) { + CMDLINEARG_DEF2(run-once, runonce, "Closes server after loading (testing).", CMDLINE_OPT_NORMAL); CMDLINEARG_DEF2(login-config, loginconfig, "Alternative login-server configuration.", CMDLINE_OPT_PARAM); CMDLINEARG_DEF2(net-config, netconfig, "Alternative subnet configuration.", CMDLINE_OPT_PARAM); } -- cgit v1.2.3-70-g09d2