numa: silence warning about return code of fscanf
Its not strictly needed but it doesn't hurt to check the return code of fscanf and it keeps the compiler happy Signed-off-by Neil Horman <nhorman@tuxdriver.com>
This commit is contained in:
parent
c126cc6c45
commit
9bbc9ef2ae
5
numa.c
5
numa.c
|
@ -54,6 +54,7 @@ static void add_one_node(const char *nodename)
|
||||||
struct topo_obj *new;
|
struct topo_obj *new;
|
||||||
char *cpustr;
|
char *cpustr;
|
||||||
FILE *f;
|
FILE *f;
|
||||||
|
int ret;
|
||||||
|
|
||||||
new = calloc(1, sizeof(struct topo_obj));
|
new = calloc(1, sizeof(struct topo_obj));
|
||||||
if (!new)
|
if (!new)
|
||||||
|
@ -63,8 +64,8 @@ static void add_one_node(const char *nodename)
|
||||||
if (ferror(f)) {
|
if (ferror(f)) {
|
||||||
cpus_clear(new->mask);
|
cpus_clear(new->mask);
|
||||||
} else {
|
} else {
|
||||||
fscanf(f, "%as", &cpustr);
|
ret = fscanf(f, "%as", &cpustr);
|
||||||
if (!cpustr) {
|
if (!ret || !cpustr) {
|
||||||
cpus_clear(new->mask);
|
cpus_clear(new->mask);
|
||||||
} else {
|
} else {
|
||||||
cpumask_parse_user(cpustr, strlen(cpustr), new->mask);
|
cpumask_parse_user(cpustr, strlen(cpustr), new->mask);
|
||||||
|
|
Loading…
Reference in a new issue