fix musl compatibility
[project/librpc-uclibc.git] / create_xid.c
index 3b4e8c08d3339d186b034fb29d802994bf80e3bd..35d26d15c2a82e821b31f061f01c5184e67062be 100644 (file)
 
 /* The RPC code is not threadsafe, but new code should be threadsafe. */
 
-#include <bits/uClibc_mutex.h>
 __UCLIBC_MUTEX_STATIC(mylock, PTHREAD_MUTEX_INITIALIZER);
 
 static smallint is_initialized;
-static struct drand48_data __rpc_lrand48_data;
 
 u_long _create_xid (void) attribute_hidden;
 u_long _create_xid (void)
@@ -46,11 +44,11 @@ u_long _create_xid (void)
       struct timeval now;
 
       gettimeofday (&now, (struct timezone *) 0);
-      srand48_r (now.tv_sec ^ now.tv_usec, &__rpc_lrand48_data);
+      srand48 (now.tv_sec ^ now.tv_usec);
       is_initialized = 1;
     }
 
-  lrand48_r (&__rpc_lrand48_data, &res);
+  res = lrand48();
 
   __UCLIBC_MUTEX_UNLOCK(mylock);