Skip to content

Commit

Permalink
tools/lxc_stop: use lxc_safe_long()
Browse files Browse the repository at this point in the history
Signed-off-by: Christian Brauner <christian.brauner@canonical.com>
  • Loading branch information
Christian Brauner authored and stgraber committed Nov 22, 2016
1 parent 45cf281 commit 9dfa6e1
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions src/lxc/tools/lxc_stop.c
Expand Up @@ -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':
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 9dfa6e1

Please sign in to comment.