diff options
-rw-r--r-- | ChangeLog | 13 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/powerpc/Makefile | 2 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/powerpc/get_timebase_freq.c | 2 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/powerpc/test-gettimebasefreq-static.c | 19 |
4 files changed, 35 insertions, 1 deletions
@@ -1,3 +1,16 @@ +2019-06-19 Stan Shebs <stanshebs@google.com> + Raoni Fassina Firmino <raoni@linux.ibm.com> + + [BZ #24640] + * sysdeps/unix/sysv/linux/powerpc/get_timebase_freq.c + [!SHARED] (__get_timebase_freq): Fix sense of a test in the + static-linking version. + * sysdeps/unix/sysv/linux/powerpc/Makefile + (tests-static): Add test-gettimebasefreq-static. + (tests): Likewise. + * sysdeps/unix/sysv/linux/powerpc/test-gettimebasefreq-static.c: + New file. + 2019-06-19 Rafal Luzynski <digitalfreak@lingonborough.com> [BZ #24614] diff --git a/sysdeps/unix/sysv/linux/powerpc/Makefile b/sysdeps/unix/sysv/linux/powerpc/Makefile index 19ac59d..1596238 100644 --- a/sysdeps/unix/sysv/linux/powerpc/Makefile +++ b/sysdeps/unix/sysv/linux/powerpc/Makefile @@ -25,6 +25,8 @@ endif ifeq ($(subdir),misc) sysdep_headers += bits/ppc.h sysdep_routines += get_timebase_freq +tests-static += test-gettimebasefreq-static +tests += $(tests-static) tests += test-gettimebasefreq tests += test-powerpc-linux-sysconf endif diff --git a/sysdeps/unix/sysv/linux/powerpc/get_timebase_freq.c b/sysdeps/unix/sysv/linux/powerpc/get_timebase_freq.c index 23e7694..c245e97 100644 --- a/sysdeps/unix/sysv/linux/powerpc/get_timebase_freq.c +++ b/sysdeps/unix/sysv/linux/powerpc/get_timebase_freq.c @@ -39,7 +39,7 @@ __get_timebase_freq (void) timebase : 33333333 We search for this line and convert the number into an integer. */ int fd = __open_nocancel ("/proc/cpuinfo", O_RDONLY); - if (__glibc_likely (fd != -1)) + if (__glibc_unlikely (fd == -1)) return result; /* The timebase will be in the 1st 1024 bytes for systems with up diff --git a/sysdeps/unix/sysv/linux/powerpc/test-gettimebasefreq-static.c b/sysdeps/unix/sysv/linux/powerpc/test-gettimebasefreq-static.c new file mode 100644 index 0000000..58b4eee --- /dev/null +++ b/sysdeps/unix/sysv/linux/powerpc/test-gettimebasefreq-static.c @@ -0,0 +1,19 @@ +/* Check __ppc_get_timebase_freq() for architecture changes + Copyright (C) 2019 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + +#include "test-gettimebasefreq.c" |