The exit code 1 refers to general error and using -1 wraps to
255, both codes do not signify bad arguments. Let's use exit code 129
(EXIT_BADARGS) for hinting to the users about invalid usage.
Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
ret = parse_cgroup_spec(cgroup_list, optarg, CG_HIER_MAX);
if (ret) {
err("cgroup controller and path parsing failed\n");
- return -1;
+ exit(EXIT_BADARGS);
}
cg_specified = 1;
break;
exit(0);
default:
usage(1, argv[0]);
- exit(1);
+ exit(EXIT_BADARGS);
}
}
/* Executable name */
if (!argv[optind]) {
usage(1, argv[0]);
- exit(1);
+ exit(EXIT_BADARGS);
}
/* Initialize libcg */