From 2a9a36aa0e94cd4026f47678bf878ea474c9cc84 Mon Sep 17 00:00:00 2001 From: Christian Brauner Date: Sat, 29 Oct 2016 12:40:15 +0200 Subject: [PATCH] tools/lxc_stop: use lxc_safe_long() Signed-off-by: Christian Brauner --- src/lxc/tools/lxc_stop.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/lxc/tools/lxc_stop.c b/src/lxc/tools/lxc_stop.c index f0786fcf1..64b742d98 100644 --- a/src/lxc/tools/lxc_stop.c +++ b/src/lxc/tools/lxc_stop.c @@ -48,7 +48,7 @@ static int my_parser(struct lxc_arguments *args, int c, char *arg) args->nowait = 1; break; case 't': - if (lxc_safe_int(arg, &args->timeout) < 0) + if (lxc_safe_long(arg, &args->timeout) < 0) return -1; break; case 'k': @@ -168,17 +168,14 @@ int main(int argc, char *argv[]) /* Set default timeout */ if (my_args.timeout == -2) { - if (my_args.hardstop) { + if (my_args.hardstop) my_args.timeout = 0; - } - else { + else my_args.timeout = 60; - } } - if (my_args.nowait) { + if (my_args.nowait) my_args.timeout = 0; - } /* some checks */ if (!my_args.hardstop && my_args.timeout < -1) {