2
0
mirror of git://github.com/lxc/lxc synced 2025-08-31 00:09:37 +00:00

tools/lxc_stop: use lxc_safe_long()

Signed-off-by: Christian Brauner <christian.brauner@canonical.com>
This commit is contained in:
Christian Brauner
2016-10-29 12:40:15 +02:00
parent cb9df6d4a7
commit 2a9a36aa0e

View File

@@ -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) {