From 05598a0907cad1350962e89b781215209a785d92 Mon Sep 17 00:00:00 2001 From: Patsy Franklin Date: Tue, 26 Jun 2018 10:35:03 -0400 Subject: In sem_open.c, pad was not initialized when __HAVE_64B_ATOMICS was true. On some arches this caused valgrind to warn about uninitialized bytes when the struct was written to the file system. This patch moves the initialization of pad outside of the conditional. Reviewed-by: Carlos O'Donell --- nptl/sem_open.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'nptl') diff --git a/nptl/sem_open.c b/nptl/sem_open.c index 1d7f142134..c5389f6873 100644 --- a/nptl/sem_open.c +++ b/nptl/sem_open.c @@ -215,10 +215,11 @@ sem_open (const char *name, int oflag, ...) sem.newsem.data = value; #else sem.newsem.value = value << SEM_VALUE_SHIFT; - /* pad is used as a mutex on pre-v9 sparc and ignored otherwise. */ - sem.newsem.pad = 0; sem.newsem.nwaiters = 0; #endif + /* pad is used as a mutex on pre-v9 sparc and ignored otherwise. */ + sem.newsem.pad = 0; + /* This always is a shared semaphore. */ sem.newsem.private = FUTEX_SHARED; -- cgit 1.4.1