Commit 487f4ee9 by Michel Normand Committed by Daniel Lezcano

change lxc-cgroup parameter checking

required to support either: lxc-cgroup -n foo subsystem value lxc-cgroup -nfoo subsystem value Signed-off-by: 's avatarMichel Normand <normand@fr.ibm.com> Signed-off-by: 's avatarDaniel Lezcano <dlezcano@fr.ibm.com>
parent a4255c08
...@@ -51,13 +51,14 @@ int main(int argc, char *argv[]) ...@@ -51,13 +51,14 @@ int main(int argc, char *argv[])
nbargs++; nbargs++;
} }
if (!name || argc < 4) if (!name || (argc-optind) < 1)
usage(argv[0]); usage(argv[0]);
if (argc >= 5) if ((argc -optind) >= 1)
value = argv[4]; subsystem = argv[optind];
subsystem = argv[3]; if ((argc -optind) >= 2)
value = argv[optind+1];
if (value) { if (value) {
if (lxc_cgroup_set(name, subsystem, value)) { if (lxc_cgroup_set(name, subsystem, value)) {
......
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