diff options
author | Mattias Andrée <maandree@operamail.com> | 2014-05-19 19:48:55 +0200 |
---|---|---|
committer | Mattias Andrée <maandree@operamail.com> | 2014-05-19 19:48:55 +0200 |
commit | 92a217d0be3dd3f19eeb8dfd883d9ce4bfed7366 (patch) | |
tree | 26adbd8051d07fc7aed94b69465c13a64242b683 /src/mds-base.c | |
parent | begin on base for servers (diff) | |
download | mds-92a217d0be3dd3f19eeb8dfd883d9ce4bfed7366.tar.gz mds-92a217d0be3dd3f19eeb8dfd883d9ce4bfed7366.tar.bz2 mds-92a217d0be3dd3f19eeb8dfd883d9ce4bfed7366.tar.xz |
m + add --alarm= options
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to '')
-rw-r--r-- | src/mds-base.c | 10 |
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_; |