diff options
author | Jakub Jelinek <jakub@redhat.com> | 2009-04-27 14:33:59 +0000 |
---|---|---|
committer | Jakub Jelinek <jakub@redhat.com> | 2009-04-27 14:33:59 +0000 |
commit | 83489168c2447e3fe351dbb302b1026dc9fc512c (patch) | |
tree | 8c0029fbf2d97cd352310c6a793bb15745a24ec4 /nptl | |
parent | 51211e710a024163f91ffd5ed29908faa3cd41e7 (diff) | |
download | glibc-83489168c2447e3fe351dbb302b1026dc9fc512c.zip glibc-83489168c2447e3fe351dbb302b1026dc9fc512c.tar.gz glibc-83489168c2447e3fe351dbb302b1026dc9fc512c.tar.bz2 |
Updated to fedora-glibc-20090427T1419cvs/fedora-glibc-2_9_90-22
Diffstat (limited to 'nptl')
-rw-r--r-- | nptl/ChangeLog | 8 | ||||
-rw-r--r-- | nptl/sem_open.c | 19 | ||||
-rw-r--r-- | nptl/sysdeps/unix/sysv/linux/libc_pthread_init.c | 8 |
3 files changed, 23 insertions, 12 deletions
diff --git a/nptl/ChangeLog b/nptl/ChangeLog index 6015f40..0a928a9 100644 --- a/nptl/ChangeLog +++ b/nptl/ChangeLog @@ -1,3 +1,11 @@ +2009-04-26 Ulrich Drepper <drepper@redhat.com> + + * sem_open.c (sem_open): Rewrite initialization of initsem to + avoid warnings. + + * sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init): + Avoid warning by using may_alias attribute on ptrhack. + 2009-04-22 Ulrich Drepper <drepper@redhat.com> [BZ #10090] diff --git a/nptl/sem_open.c b/nptl/sem_open.c index e58dde9..4e60349 100644 --- a/nptl/sem_open.c +++ b/nptl/sem_open.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002, 2003, 2006, 2007 Free Software Foundation, Inc. +/* Copyright (C) 2002, 2003, 2006, 2007, 2009 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. @@ -302,15 +302,18 @@ sem_open (const char *name, int oflag, ...) } /* Create the initial file content. */ - sem_t initsem; + union + { + sem_t initsem; + struct new_sem newsem; + } sem; - struct new_sem *iinitsem = (struct new_sem *) &initsem; - iinitsem->value = value; - iinitsem->private = 0; - iinitsem->nwaiters = 0; + sem.newsem.value = value; + sem.newsem.private = 0; + sem.newsem.nwaiters = 0; /* Initialize the remaining bytes as well. */ - memset ((char *) &initsem + sizeof (struct new_sem), '\0', + memset ((char *) &sem.initsem + sizeof (struct new_sem), '\0', sizeof (sem_t) - sizeof (struct new_sem)); tmpfname = (char *) alloca (mountpoint.dirlen + 6 + 1); @@ -349,7 +352,7 @@ sem_open (const char *name, int oflag, ...) break; } - if (TEMP_FAILURE_RETRY (__libc_write (fd, &initsem, sizeof (sem_t))) + if (TEMP_FAILURE_RETRY (__libc_write (fd, &sem.initsem, sizeof (sem_t))) == sizeof (sem_t) /* Map the sem_t structure from the file. */ && (result = (sem_t *) mmap (NULL, sizeof (sem_t), diff --git a/nptl/sysdeps/unix/sysv/linux/libc_pthread_init.c b/nptl/sysdeps/unix/sysv/linux/libc_pthread_init.c index 4b614bd..8924c4f 100644 --- a/nptl/sysdeps/unix/sysv/linux/libc_pthread_init.c +++ b/nptl/sysdeps/unix/sysv/linux/libc_pthread_init.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002, 2003, 2005, 2006, 2007 Free Software Foundation, Inc. +/* Copyright (C) 2002,2003,2005,2006,2007,2009 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. @@ -56,10 +56,10 @@ __libc_pthread_init (ptr, reclaim, functions) union ptrhack { struct pthread_functions pf; - void *parr[1]; - } const *src; - union ptrhack *dest; # define NPTRS (sizeof (struct pthread_functions) / sizeof (void *)) + void *parr[NPTRS]; + } __attribute__ ((may_alias)) const *src; + union ptrhack *dest; src = (const void *) functions; dest = (void *) &__libc_pthread_functions; |