mirror of
https://sourceware.org/git/glibc.git
synced 2025-07-30 22:43:12 +03:00
Use glibc_likely instead __builtin_expect.
This commit is contained in:
@ -65,7 +65,7 @@ fchownat (int fd, const char *file, uid_t owner, gid_t group, int flag)
|
||||
if (fd != AT_FDCWD && file[0] != '/')
|
||||
{
|
||||
size_t filelen = strlen (file);
|
||||
if (__builtin_expect (filelen == 0, 0))
|
||||
if (__glibc_unlikely (filelen == 0))
|
||||
{
|
||||
__set_errno (ENOENT);
|
||||
return -1;
|
||||
@ -93,7 +93,7 @@ fchownat (int fd, const char *file, uid_t owner, gid_t group, int flag)
|
||||
else
|
||||
result = INTERNAL_SYSCALL (chown, err, 3, file, owner, group);
|
||||
|
||||
if (__builtin_expect (INTERNAL_SYSCALL_ERROR_P (result, err), 0))
|
||||
if (__glibc_unlikely (INTERNAL_SYSCALL_ERROR_P (result, err)))
|
||||
{
|
||||
__atfct_seterrno (INTERNAL_SYSCALL_ERRNO (result, err), fd, buf);
|
||||
return -1;
|
||||
|
@ -49,7 +49,7 @@ __get_clockfreq (void)
|
||||
{
|
||||
int fd = __open ("/proc/cpuinfo", O_RDONLY);
|
||||
|
||||
if (__builtin_expect (fd != -1, 1))
|
||||
if (__glibc_likely (fd != -1))
|
||||
{
|
||||
/* The timebase will be in the 1st 1024 bytes for systems with up
|
||||
to 8 processors. If the first read returns less then 1024
|
||||
@ -87,7 +87,7 @@ __get_clockfreq (void)
|
||||
{
|
||||
char *mhz = memmem (buf, n, "timebase", 7);
|
||||
|
||||
if (__builtin_expect (mhz != NULL, 1))
|
||||
if (__glibc_likely (mhz != NULL))
|
||||
{
|
||||
char *endp = buf + n;
|
||||
|
||||
|
Reference in New Issue
Block a user