summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-07-03 17:56:41 +0300
committerAndrei Karas <akaras@inbox.ru>2016-07-03 17:56:41 +0300
commit1e07ec7b4d232902530f3457e7237353a40262f6 (patch)
tree636f73feb6b1d975251ca7eb0b22f50adf9717f1
parentc96e3c44f59333378adb87d155884b1bea1a25d0 (diff)
downloadhercules-1e07ec7b4d232902530f3457e7237353a40262f6.tar.gz
hercules-1e07ec7b4d232902530f3457e7237353a40262f6.tar.bz2
hercules-1e07ec7b4d232902530f3457e7237353a40262f6.tar.xz
hercules-1e07ec7b4d232902530f3457e7237353a40262f6.zip
Add --run-once flag into login server.
-rwxr-xr-xconfigure2
-rw-r--r--src/login/login.c14
2 files changed, 15 insertions, 1 deletions
diff --git a/configure b/configure
index d5d5528c0..88950feb3 100755
--- a/configure
+++ b/configure
@@ -1,5 +1,5 @@
#! /bin/sh
-# From configure.ac 690e18f.
+# From configure.ac c96e3c4.
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.69.
#
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);
}