Fix calculation of CPU set size for getaffinity.

* libguile/posix.c (cpu_set_to_bitvector): Use CPU_SETSIZE, not
  sizeof, to compute the size of the CPU set.
This commit is contained in:
Eli Zaretskii 2014-07-03 19:30:02 +03:00
commit 9dc3fc4dd4

View file

@ -1979,9 +1979,9 @@ cpu_set_to_bitvector (const cpu_set_t *cs)
SCM bv;
size_t cpu;
bv = scm_c_make_bitvector (sizeof (*cs), SCM_BOOL_F);
bv = scm_c_make_bitvector (CPU_SETSIZE, SCM_BOOL_F);
for (cpu = 0; cpu < sizeof (*cs); cpu++)
for (cpu = 0; cpu < CPU_SETSIZE; cpu++)
{
if (CPU_ISSET (cpu, cs))
/* XXX: This is inefficient but avoids code duplication. */