summary refs log tree commit diff
path: root/sysdeps/unix/i386
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/unix/i386')
-rw-r--r--sysdeps/unix/i386/i586/clock_getres.c2
-rw-r--r--sysdeps/unix/i386/i586/clock_gettime.c6
2 files changed, 5 insertions, 3 deletions
diff --git a/sysdeps/unix/i386/i586/clock_getres.c b/sysdeps/unix/i386/i586/clock_getres.c
index abafcc079b..dacf7f49d3 100644
--- a/sysdeps/unix/i386/i586/clock_getres.c
+++ b/sysdeps/unix/i386/i586/clock_getres.c
@@ -43,7 +43,7 @@ static long int nsec;
 #define EXTRA_CLOCK_CASES \
   case __CLOCK_HIGHRES:							      \
     {									      \
-      if (__builtin_expect (nsec != 0, 0))				      \
+      if (__builtin_expect (nsec == 0, 0))				      \
 	{								      \
 	  unsigned long long int freq;					      \
 									      \
diff --git a/sysdeps/unix/i386/i586/clock_gettime.c b/sysdeps/unix/i386/i586/clock_gettime.c
index f623cecd09..bb63874a86 100644
--- a/sysdeps/unix/i386/i586/clock_gettime.c
+++ b/sysdeps/unix/i386/i586/clock_gettime.c
@@ -44,7 +44,7 @@ static unsigned long long int freq;
     {									      \
       unsigned long long int tsc;					      \
 									      \
-      if (__builtin_expect (freq != 0, 0))				      \
+      if (__builtin_expect (freq == 0, 0))				      \
 	{								      \
 	  /* This can only happen if we haven't initialized the `freq'	      \
 	     variable yet.  Do this now. We don't have to protect this	      \
@@ -64,7 +64,9 @@ static unsigned long long int freq;
 									      \
       /* And the nanoseconds.  This computation should be stable until	      \
 	 we get machines with about 16GHz frequency.  */		      \
-      tp->tv_nsec = ((tsc % freq) * 1000000000ULL) / freq;		      \
+      tp->tv_nsec = ((tsc % freq) * 1000000000ull) / freq;		      \
+									      \
+      retval = 0;							      \
     }									      \
     break;