Commit c453697f by Christian Brauner Committed by Stéphane Graber

tools/lxc_stop: use lxc_safe_uint()

parent dc1e435f
...@@ -38,15 +38,28 @@ ...@@ -38,15 +38,28 @@
lxc_log_define(lxc_stop_ui, lxc); lxc_log_define(lxc_stop_ui, lxc);
static int my_parser(struct lxc_arguments* args, int c, char* arg) static int my_parser(struct lxc_arguments *args, int c, char *arg)
{ {
switch (c) { switch (c) {
case 'r': args->reboot = 1; break; case 'r':
case 'W': args->nowait = 1; break; args->reboot = 1;
case 't': args->timeout = atoi(arg); break; break;
case 'k': args->hardstop = 1; break; case 'W':
case OPT_NO_LOCK: args->nolock = 1; break; args->nowait = 1;
case OPT_NO_KILL: args->nokill = 1; break; break;
case 't':
if (lxc_safe_int(arg, &args->timeout) < 0)
return -1;
break;
case 'k':
args->hardstop = 1;
break;
case OPT_NO_LOCK:
args->nolock = 1;
break;
case OPT_NO_KILL:
args->nokill = 1;
break;
} }
return 0; return 0;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment