/*
- * SPDX-License-Identifier: LGPL-2.1-only
+ * SPDX-License-Identifier: MIT
*
* Copyright (C) 2011-2012 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
* Copyright (C) 2019 Michael Jeanson <mjeanson@efficios.com>
}
}
+ 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.
total_bytes_read += bytes_read;
assert(total_bytes_read <= max_bytes);
- } while (max_bytes > total_bytes_read && bytes_read > 0);
+ } while (max_bytes > total_bytes_read && bytes_read != 0);
/*
* Make sure the mask read is a null terminated string.
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;