about summary refs log tree commit diff
path: root/sysdeps
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps')
-rw-r--r--sysdeps/generic/bits/in.h8
-rw-r--r--sysdeps/unix/i386/i586/clock_getres.c2
-rw-r--r--sysdeps/unix/i386/i586/clock_gettime.c6
-rw-r--r--sysdeps/unix/sysv/linux/bits/in.h12
-rw-r--r--sysdeps/unix/sysv/linux/i386/get_clockfreq.c6
5 files changed, 24 insertions, 10 deletions
diff --git a/sysdeps/generic/bits/in.h b/sysdeps/generic/bits/in.h
index 8cafffc6fe..36f6705dfd 100644
--- a/sysdeps/generic/bits/in.h
+++ b/sysdeps/generic/bits/in.h
@@ -79,8 +79,12 @@ struct ip_mreq
 #define IPV6_MULTICAST_IF	17
 #define IPV6_MULTICAST_HOPS	18
 #define IPV6_MULTICAST_LOOP	19
-#define IPV6_ADD_MEMBERSHIP	20
-#define IPV6_DROP_MEMBERSHIP	21
+#define IPV6_JOIN_GROUP		20
+#define IPV6_LEAVE_GROUP	21
+
+/* Obsolete synonyms for the above.  */
+#define IPV6_ADD_MEMBERSHIP	IPV6_JOIN_GROUP
+#define IPV6_DROP_MEMBERSHIP	IPV6_LEAVE_GROUP
 
 /* Routing header options for IPv6.  */
 #define IPV6_RTHDR_LOOSE	0	/* Hop doesn't need to be neighbour. */
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;
 
diff --git a/sysdeps/unix/sysv/linux/bits/in.h b/sysdeps/unix/sysv/linux/bits/in.h
index 8efe2427a4..6778d3fd86 100644
--- a/sysdeps/unix/sysv/linux/bits/in.h
+++ b/sysdeps/unix/sysv/linux/bits/in.h
@@ -109,8 +109,8 @@ struct in_pktinfo
 #define IPV6_MULTICAST_IF	17
 #define IPV6_MULTICAST_HOPS	18
 #define IPV6_MULTICAST_LOOP	19
-#define IPV6_ADD_MEMBERSHIP	20
-#define IPV6_DROP_MEMBERSHIP	21
+#define IPV6_JOIN_GROUP		20
+#define IPV6_LEAVE_GROUP	21
 #define IPV6_ROUTER_ALERT	22
 #define IPV6_MTU_DISCOVER	23
 #define IPV6_MTU		24
@@ -118,8 +118,12 @@ struct in_pktinfo
 
 #define SCM_SRCRT		IPV6_RXSRCRT
 
-#define IPV6_RXHOPOPTS		IPV6_HOPOPTS	/* obsolete name */
-#define IPV6_RXDSTOPTS		IPV6_DSTOPTS	/* obsolete name */
+/* Obsolete synonyms for the above.  */
+#define IPV6_RXHOPOPTS		IPV6_HOPOPTS
+#define IPV6_RXDSTOPTS		IPV6_DSTOPTS
+#define IPV6_ADD_MEMBERSHIP	IPV6_JOIN_GROUP
+#define IPV6_DROP_MEMBERSHIP	IPV6_LEAVE_GROUP
+
 
 /* IPV6_MTU_DISCOVER values.  */
 #define IPV6_PMTUDISC_DONT	0	/* Never send DF frames.  */
diff --git a/sysdeps/unix/sysv/linux/i386/get_clockfreq.c b/sysdeps/unix/sysv/linux/i386/get_clockfreq.c
index 28f56c8fc3..65b7bb2116 100644
--- a/sysdeps/unix/sysv/linux/i386/get_clockfreq.c
+++ b/sysdeps/unix/sysv/linux/i386/get_clockfreq.c
@@ -29,9 +29,13 @@ __get_clockfreq (void)
      least one line like
 	cpu MHz         : 497.840237
      We search for this line and convert the number in an integer.  */
-  unsigned long long int result = 0ull;
+  static unsigned long long int result;
   int fd;
 
+  /* If this function was called before, we know the result.  */
+  if (result != 0)
+    return result;
+
   fd = open ("/proc/cpuinfo", O_RDONLY);
   if (__builtin_expect (fd != -1, 1))
     {