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:
Neil Horman 2011-11-04 11:34:44 -04:00
parent c126cc6c45
commit 9bbc9ef2ae

5
numa.c
View file

@ -54,6 +54,7 @@ static void add_one_node(const char *nodename)
struct topo_obj *new;
char *cpustr;
FILE *f;
int ret;
new = calloc(1, sizeof(struct topo_obj));
if (!new)
@ -63,8 +64,8 @@ static void add_one_node(const char *nodename)
if (ferror(f)) {
cpus_clear(new->mask);
} else {
fscanf(f, "%as", &cpustr);
if (!cpustr) {
ret = fscanf(f, "%as", &cpustr);
if (!ret || !cpustr) {
cpus_clear(new->mask);
} else {
cpumask_parse_user(cpustr, strlen(cpustr), new->mask);