mirror of
git://github.com/lxc/lxc
synced 2025-09-01 08:00:26 +00:00
tools/lxc_stop: use lxc_safe_long()
Signed-off-by: Christian Brauner <christian.brauner@canonical.com>
This commit is contained in:
@@ -48,7 +48,7 @@ static int my_parser(struct lxc_arguments *args, int c, char *arg)
|
|||||||
args->nowait = 1;
|
args->nowait = 1;
|
||||||
break;
|
break;
|
||||||
case 't':
|
case 't':
|
||||||
if (lxc_safe_int(arg, &args->timeout) < 0)
|
if (lxc_safe_long(arg, &args->timeout) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
break;
|
break;
|
||||||
case 'k':
|
case 'k':
|
||||||
@@ -168,17 +168,14 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
/* Set default timeout */
|
/* Set default timeout */
|
||||||
if (my_args.timeout == -2) {
|
if (my_args.timeout == -2) {
|
||||||
if (my_args.hardstop) {
|
if (my_args.hardstop)
|
||||||
my_args.timeout = 0;
|
my_args.timeout = 0;
|
||||||
}
|
else
|
||||||
else {
|
|
||||||
my_args.timeout = 60;
|
my_args.timeout = 60;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (my_args.nowait) {
|
if (my_args.nowait)
|
||||||
my_args.timeout = 0;
|
my_args.timeout = 0;
|
||||||
}
|
|
||||||
|
|
||||||
/* some checks */
|
/* some checks */
|
||||||
if (!my_args.hardstop && my_args.timeout < -1) {
|
if (!my_args.hardstop && my_args.timeout < -1) {
|
||||||
|
Reference in New Issue
Block a user