aboutsummaryrefslogtreecommitdiffstats
path: root/src/mds-base.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/mds-base.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/mds-base.c b/src/mds-base.c
index 433564e..ede29c3 100644
--- a/src/mds-base.c
+++ b/src/mds-base.c
@@ -49,6 +49,10 @@ int socket_fd = -1;
*/
static int parse_cmdline(void)
{
+#if (LIBEXEC_ARGC_EXTRA_LIMIT < 2)
+# error LIBEXEC_ARGC_EXTRA_LIMIT is too small, need at least 2.
+#endif
+
int i;
for (i = 1; i < argc; i++)
{
@@ -64,6 +68,8 @@ static int parse_cmdline(void)
}
else if (strequals(arg, "--re-exec")) /* Re-exec state-marshal. */
is_reexec = 1;
+ else if (startswith(arg, "--alarm=")) /* Schedule an alarm signal for forced abort. */
+ alarm((unsigned)min(atoi(arg + strlen("--alarm=")), 60)); /* At most 1 minute. */
}
if (is_reexec)
{
@@ -117,10 +123,6 @@ int main(int argc_, char** argv_)
{
int r;
-#if (LIBEXEC_ARGC_EXTRA_LIMIT < 2)
-# error LIBEXEC_ARGC_EXTRA_LIMIT is too small, need at least 2.
-#endif
-
argc = argc_;
argv = argv_;