diff options
author | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2010-09-03 00:20:42 +0200 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2010-09-03 00:20:42 +0200 |
commit | ba5c9d57be1a4e8167747dfdf4d94c2e03b9e24d (patch) | |
tree | c999c0603c1a8404677069377c1e19293e81453f /sysdeps | |
parent | 59ce2f2ebf8eb60b34fec056d8e6ccc9ad5ef6f8 (diff) |
Fix __sched_param / sched_param conversion
* sysdeps/generic/pt-attr-getschedparam.c (pthread_attr_getschedparam):
memcpy from `attr->schedparam' to `param' to convert from __sched_param
to sched_param.
* sysdeps/generic/pt-attr-setschedparam.c (pthread_attr_setschedparam):
memcpy from `param' to `attr->schedparam' to convert from sched_param
to __sched_param.
Diffstat (limited to 'sysdeps')
-rw-r--r-- | sysdeps/generic/pt-attr-getschedparam.c | 2 | ||||
-rw-r--r-- | sysdeps/generic/pt-attr-setschedparam.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/sysdeps/generic/pt-attr-getschedparam.c b/sysdeps/generic/pt-attr-getschedparam.c index 25afebd0..6c3f15be 100644 --- a/sysdeps/generic/pt-attr-getschedparam.c +++ b/sysdeps/generic/pt-attr-getschedparam.c @@ -26,6 +26,6 @@ int pthread_attr_getschedparam (const pthread_attr_t *attr, struct sched_param *param) { - *param = attr->schedparam; + memcpy (param, &attr->schedparam, sizeof *param); return 0; } diff --git a/sysdeps/generic/pt-attr-setschedparam.c b/sysdeps/generic/pt-attr-setschedparam.c index 18a575ec..5459f108 100644 --- a/sysdeps/generic/pt-attr-setschedparam.c +++ b/sysdeps/generic/pt-attr-setschedparam.c @@ -30,7 +30,7 @@ pthread_attr_setschedparam (pthread_attr_t *attr, if (memcmp (param, &__pthread_default_attr.schedparam, sizeof *param) == 0) { - attr->schedparam = *param; + memcpy (&attr->schedparam, param, sizeof *param); return 0; } |