From: Christian Brauner Date: Sat, 29 Oct 2016 10:40:15 +0000 (+0200) Subject: tools/lxc_stop: use lxc_safe_long() X-Git-Tag: lxc-2.1.0~257^2~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2a9a36aa0e94cd4026f47678bf878ea474c9cc84;p=thirdparty%2Flxc.git tools/lxc_stop: use lxc_safe_long() Signed-off-by: Christian Brauner --- 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) {