]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
tools/lxc_stop: use lxc_safe_long()
authorChristian Brauner <christian.brauner@canonical.com>
Sat, 29 Oct 2016 10:40:15 +0000 (12:40 +0200)
committerChristian Brauner <christian.brauner@canonical.com>
Tue, 22 Nov 2016 03:46:15 +0000 (04:46 +0100)
Signed-off-by: Christian Brauner <christian.brauner@canonical.com>
src/lxc/tools/lxc_stop.c

index f0786fcf12b028ba322a2c22202771c819a55281..64b742d98ce6dde56d1049b786b656613209c8f9 100644 (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) {