From 9bbc9ef2ae3aaa76db011cc11cd387a717e6c378 Mon Sep 17 00:00:00 2001 From: Neil Horman Date: Fri, 4 Nov 2011 11:34:44 -0400 Subject: [PATCH] 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 --- numa.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/numa.c b/numa.c index 26184a4..bc68bb9 100644 --- a/numa.c +++ b/numa.c @@ -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);