[RFC,02/12] y2038: Rename timespec_compare to __timespec_compare

Message ID 20200601140740.16371-3-lukma@denx.de
State Dropped
Delegated to: Lukasz Majewski
Headers
Series y2038: Convert timespec_{sub|add|create} in support to be Y2038 safe |

Commit Message

Lukasz Majewski June 1, 2020, 2:07 p.m. UTC
  As the timespec_compare is used locally in glibc, its name shall begin with
"__". This change adds this prefix.

Tested with glibc/glibc-many-build --keep failed glibcs
---
 sysdeps/pthread/posix-timer.h    | 2 +-
 sysdeps/pthread/timer_gettime.c  | 2 +-
 sysdeps/pthread/timer_routines.c | 6 +++---
 3 files changed, 5 insertions(+), 5 deletions(-)
  

Patch

diff --git a/sysdeps/pthread/posix-timer.h b/sysdeps/pthread/posix-timer.h
index 81fc8a2394..7d9207e23d 100644
--- a/sysdeps/pthread/posix-timer.h
+++ b/sysdeps/pthread/posix-timer.h
@@ -115,7 +115,7 @@  timer_delref (struct timer_node *timer)
 /* Timespec helper routines.  */
 static inline int
 __attribute ((always_inline))
-timespec_compare (const struct timespec *left, const struct timespec *right)
+__timespec_compare (const struct timespec *left, const struct timespec *right)
 {
   if (left->tv_sec < right->tv_sec)
     return -1;
diff --git a/sysdeps/pthread/timer_gettime.c b/sysdeps/pthread/timer_gettime.c
index 5723e5f818..6cbf87f434 100644
--- a/sysdeps/pthread/timer_gettime.c
+++ b/sysdeps/pthread/timer_gettime.c
@@ -51,7 +51,7 @@  timer_gettime (timer_t timerid, struct itimerspec *value)
       if (armed)
 	{
 	  __clock_gettime (clock, &now);
-	  if (timespec_compare (&now, &expiry) < 0)
+	  if (__timespec_compare (&now, &expiry) < 0)
 	    timespec_sub (&value->it_value, &expiry, &now);
 	  else
 	    {
diff --git a/sysdeps/pthread/timer_routines.c b/sysdeps/pthread/timer_routines.c
index 05e83d7d52..be9b09a832 100644
--- a/sysdeps/pthread/timer_routines.c
+++ b/sysdeps/pthread/timer_routines.c
@@ -383,7 +383,7 @@  thread_func (void *arg)
 	      /* If the timer is due or overdue, remove it from the queue.
 		 If it's a periodic timer, re-compute its new time and
 		 requeue it.  Either way, perform the timer expiry. */
-	      if (timespec_compare (&now, &timer->expirytime) < 0)
+	      if (__timespec_compare (&now, &timer->expirytime) < 0)
 		break;
 
 	      list_unlink_ip (first);
@@ -394,7 +394,7 @@  thread_func (void *arg)
 		  timer->overrun_count = 0;
 		  timespec_add (&timer->expirytime, &timer->expirytime,
 				&timer->value.it_interval);
-		  while (timespec_compare (&timer->expirytime, &now) < 0)
+		  while (__timespec_compare (&timer->expirytime, &now) < 0)
 		    {
 		      timespec_add (&timer->expirytime, &timer->expirytime,
 				    &timer->value.it_interval);
@@ -447,7 +447,7 @@  __timer_thread_queue_timer (struct thread_node *thread,
     {
       struct timer_node *timer = timer_links2ptr (iter);
 
-      if (timespec_compare (&insert->expirytime, &timer->expirytime) < 0)
+      if (__timespec_compare (&insert->expirytime, &timer->expirytime) < 0)
 	  break;
       athead = 0;
     }