diff options
Diffstat (limited to 'nptl')
-rw-r--r-- | nptl/ChangeLog | 7 | ||||
-rw-r--r-- | nptl/pthread_getattr_np.c | 6 |
2 files changed, 11 insertions, 2 deletions
diff --git a/nptl/ChangeLog b/nptl/ChangeLog index efea03e6a2..243ad921b8 100644 --- a/nptl/ChangeLog +++ b/nptl/ChangeLog @@ -1,3 +1,10 @@ +2004-03-22 Jakub Jelinek <jakub@redhat.com> + + * sysdeps/unix/sysv/linux/pthread_getaffinity.c + (__pthread_getaffinity_new): Use INT_MAX instead of UINT_MAX. + * pthread_getattr_np.c (pthread_getattr_np): Double size every cycle. + If realloc fails, break out of the loop. + 2004-03-20 Andreas Jaeger <aj@suse.de> * sysdeps/unix/sysv/linux/pthread_setaffinity.c diff --git a/nptl/pthread_getattr_np.c b/nptl/pthread_getattr_np.c index df11b1ff1d..d0c2c8b880 100644 --- a/nptl/pthread_getattr_np.c +++ b/nptl/pthread_getattr_np.c @@ -135,16 +135,18 @@ pthread_getattr_np (thread_id, attr) if (ret == 0) { - size_t size = 32; + size_t size = 16; cpu_set_t *cpuset = NULL; do { + size <<= 1; + void *newp = realloc (cpuset, size); if (newp == NULL) { - free (cpuset); ret = ENOMEM; + break; } cpuset = (cpu_set_t *) newp; |