diff options
author | Heiko Carstens | 2011-08-15 07:52:44 +0200 |
---|---|---|
committer | Heiko Carstens | 2011-08-15 07:52:44 +0200 |
commit | b16f615afb8339b46e343e5dc292d1090ebff807 (patch) | |
tree | 6668ad4107b01765c9251fb9aaa6aec53dea3ee0 /sys-utils/lscpu.c | |
parent | ipcs: use unsigned type for uid/gid (diff) | |
download | kernel-qcow2-util-linux-b16f615afb8339b46e343e5dc292d1090ebff807.tar.gz kernel-qcow2-util-linux-b16f615afb8339b46e343e5dc292d1090ebff807.tar.xz kernel-qcow2-util-linux-b16f615afb8339b46e343e5dc292d1090ebff807.zip |
cpuset: add option to allow cpulist_parse() to fail
This is a preparation patch for chcpu. If a cpu should be added to
a cpu_set where the cpu doesn't fit into the cpu_set this got silently
ignored.
Since the cpu-list is user space provided it should be checked if cpus
are specified that are completely out of range of the system.
In order to do that add a parameter which specifies if cpulist_parse()
should fail if it parses a cpu-list with "impossible" cpus.
The current callers have been converted so they behave like before.
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Diffstat (limited to 'sys-utils/lscpu.c')
-rw-r--r-- | sys-utils/lscpu.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sys-utils/lscpu.c b/sys-utils/lscpu.c index 50daf3c4c..12779f1b1 100644 --- a/sys-utils/lscpu.c +++ b/sys-utils/lscpu.c @@ -304,7 +304,7 @@ path_cpuparse(int islist, const char *path, va_list ap) err(EXIT_FAILURE, _("failed to callocate cpu set")); if (islist) { - if (cpulist_parse(buf, set, setsize)) + if (cpulist_parse(buf, set, setsize, 0)) errx(EXIT_FAILURE, _("failed to parse CPU list %s"), buf); } else { if (cpumask_parse(buf, set, setsize)) |