summaryrefslogtreecommitdiffstatsabout
diff options
context:
space:
mode:
authorJiaojinxing <jiaojinxing1987@gmail.com>2017-08-12 08:57:02 (GMT)
committer Jiaojinxing <jiaojinxing1987@gmail.com>2017-08-12 08:57:02 (GMT)
commitca85b3b7bd15c1bfd3a2517f405a005486b6ba72 (patch)
tree3b04e24fe4ff225d1a2cfec19ff217534a7d8a94
parent4fd5edcb36eeb0f2d50b17eff3b6668b703c8487 (diff)
downloadlibsunrpc-ca85b3b7bd15c1bfd3a2517f405a005486b6ba72.zip
libsunrpc-ca85b3b7bd15c1bfd3a2517f405a005486b6ba72.tar.gz
libsunrpc-ca85b3b7bd15c1bfd3a2517f405a005486b6ba72.tar.bz2
Use getpid instead API_ThreadIdSelf function to create xid.HEADmaster
-rw-r--r--sunrpc/create_xid.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/sunrpc/create_xid.c b/sunrpc/create_xid.c
index 2f132a1..f4d9172 100644
--- a/sunrpc/create_xid.c
+++ b/sunrpc/create_xid.c
@@ -22,7 +22,7 @@
#ifndef SYLIXOS
#include <libc-lock.h>
#endif
-#include <kernrpc/rpc.h>
+#include <rpc/rpc.h>
/* The RPC code is not threadsafe, but new code should be threadsafe. */
@@ -33,11 +33,6 @@ static pid_t is_initialized;
static struct drand48_data __rpc_lrand48_data;
#endif
-static int getktid (void)
-{
- return ((int)API_ThreadIdSelf() & 0xffff);
-}
-
unsigned long
_create_xid (void)
{
@@ -45,7 +40,7 @@ _create_xid (void)
__libc_lock_lock (createxid_lock);
- pid_t pid = (pid_t)getktid ();
+ pid_t pid = getpid ();
if (is_initialized != pid)
{
struct timeval now;
@@ -53,7 +48,7 @@ _create_xid (void)
__gettimeofday (&now, (struct timezone *) 0);
#ifndef SYLIXOS
__srand48_r (now.tv_sec ^ now.tv_usec ^ pid,
- &__rpc_lrand48_data);
+ &__rpc_lrand48_data);
#else
srand48(now.tv_sec ^ now.tv_usec ^ pid);
#endif