X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=src%2Fcommon%2Fsmp.c;h=72df6d6df2f1d66271deb88f5c2f894ef2077bf6;hb=6f09d4ea6f7e38b16dcf92474d3f7a23583d4992;hp=8c742028039a10395b099202a741f490bc72fe2d;hpb=fb0f6ca9385e1813311cfd917c130b40bec04970;p=lttng-ust.git diff --git a/src/common/smp.c b/src/common/smp.c index 8c742028..72df6d6d 100644 --- a/src/common/smp.c +++ b/src/common/smp.c @@ -73,6 +73,9 @@ int _get_max_cpuid_from_sysfs(const char *path) } } + if (closedir(cpudir)) + PERROR("closedir"); + /* * If the max CPU id is out of bound, set it to -1 so it results in a * CPU num of 0. @@ -212,10 +215,6 @@ int get_max_cpuid_from_mask(const char *pmask, size_t len) cpu_index = strtoul(&pmask[i], &endptr, 10); - /* - * If we read a CPU index, increment it by one to return a number of - * CPUs. - */ if ((&pmask[i] != endptr) && (cpu_index < INT_MAX)) return (int) cpu_index;