diff options
author | Eli Zaretskii <eliz@gnu.org> | 2014-07-03 19:30:02 +0300 |
---|---|---|
committer | Eli Zaretskii <eliz@gnu.org> | 2014-07-03 19:30:02 +0300 |
commit | 9dc3fc4dd474ce4da6a45dcf197e1f99a9a7047a (patch) | |
tree | cbbbbfe1a00a50e4ff0420f8f31fc07635e75076 | |
parent | 5102fc3790a781af8fc124cc6f1e6a1fd990ceb9 (diff) | |
download | guile-9dc3fc4dd474ce4da6a45dcf197e1f99a9a7047a.tar.gz |
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.
-rw-r--r-- | libguile/posix.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libguile/posix.c b/libguile/posix.c index 1dcb5acbb..7fc690305 100644 --- a/libguile/posix.c +++ b/libguile/posix.c @@ -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. */ |