From f672076efaa2c99d1dac92070f1723a8a6378456 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Sat, 28 Apr 2007 04:03:38 +0000 Subject: [BZ #4306] 2007-04-27 Ulrich Drepper [BZ #4306] * sysdeps/unix/sysv/linux/timer_create.c (timer_create): Initialize the whole sigevent structure to appease valgrind. --- nptl/ChangeLog | 6 ++++++ nptl/sysdeps/unix/sysv/linux/timer_create.c | 13 ++++++------- sysdeps/unix/sysv/linux/sched_getcpu.c | 7 +++---- 3 files changed, 15 insertions(+), 11 deletions(-) diff --git a/nptl/ChangeLog b/nptl/ChangeLog index 0978e5d5c0..3821229684 100644 --- a/nptl/ChangeLog +++ b/nptl/ChangeLog @@ -1,3 +1,9 @@ +2007-04-27 Ulrich Drepper + + [BZ #4306] + * sysdeps/unix/sysv/linux/timer_create.c (timer_create): + Initialize the whole sigevent structure to appease valgrind. + 2007-04-25 Ulrich Drepper * sysdeps/x86_64/tls.h (tcbhead_t): Add vgetcpu_cache. diff --git a/nptl/sysdeps/unix/sysv/linux/timer_create.c b/nptl/sysdeps/unix/sysv/linux/timer_create.c index 5e99513950..497068b554 100644 --- a/nptl/sysdeps/unix/sysv/linux/timer_create.c +++ b/nptl/sysdeps/unix/sysv/linux/timer_create.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2003,2004 Free Software Foundation, Inc. +/* Copyright (C) 2003,2004, 2007 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper , 2003. @@ -193,12 +193,11 @@ timer_create (clock_id, evp, timerid) PTHREAD_CREATE_DETACHED); /* Create the event structure for the kernel timer. */ - struct sigevent sev; - sev.sigev_value.sival_ptr = newp; - sev.sigev_signo = SIGTIMER; - sev.sigev_notify = SIGEV_SIGNAL | SIGEV_THREAD_ID; - /* This is the thread ID of the helper thread. */ - sev._sigev_un._pad[0] = __helper_tid; + struct sigevent sev = + { .sigev_value.sival_ptr = newp, + .sigev_signo = SIGTIMER, + .sigev_notify = SIGEV_SIGNAL | SIGEV_THREAD_ID, + ._sigev_un = { ._pad = { [0] = __helper_tid } } }; /* Create the timer. */ INTERNAL_SYSCALL_DECL (err); diff --git a/sysdeps/unix/sysv/linux/sched_getcpu.c b/sysdeps/unix/sysv/linux/sched_getcpu.c index d0c0132eb9..e41eee6431 100644 --- a/sysdeps/unix/sysv/linux/sched_getcpu.c +++ b/sysdeps/unix/sysv/linux/sched_getcpu.c @@ -16,6 +16,7 @@ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ +#include #include #include @@ -25,11 +26,9 @@ sched_getcpu (void) { #ifdef __NR_getcpu unsigned int cpu; - INTERNAL_SYSCALL_DECL (err); - int r = INTERNAL_SYSCALL (getcpu, err, &cpu, NULL, NULL); + int r = INLINE_SYSCALL (getcpu, 3, &cpu, NULL, NULL); - return (INTERNAL_SYSCALL_ERROR (r, err) - ? INTERNAL_SYSCALL_ERRNO (r, err) : cpu); + return r == -1 ? r : cpu; #else __set_errno (ENOSYS); return -1; -- cgit v1.2.3