1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-20 11:40:18 +02:00

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
parent 5102fc3790
commit 9dc3fc4dd4

View file

@ -1979,9 +1979,9 @@ cpu_set_to_bitvector (const cpu_set_t *cs)
SCM bv; SCM bv;
size_t cpu; 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)) if (CPU_ISSET (cpu, cs))
/* XXX: This is inefficient but avoids code duplication. */ /* XXX: This is inefficient but avoids code duplication. */