From: Ronnie Sahlberg Date: Fri, 25 Oct 2013 23:16:43 +0000 (-0700) Subject: Mix in the pid in the top 16 bits for the initial xid. X-Git-Tag: upstream/1.9.6^2~182 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=6fda9871a037fdbac341f55f0b9a175e3977281e;p=deb_libnfs.git Mix in the pid in the top 16 bits for the initial xid. This helps for users which rapidly fork a lot of processes that then immediately create a new context (I am looking at you dbench) to awoid having lots of processes starting and using overlapping xid values. --- diff --git a/lib/init.c b/lib/init.c index 62a8f81..2a451a1 100644 --- a/lib/init.c +++ b/lib/init.c @@ -70,7 +70,7 @@ struct rpc_context *rpc_init_context(void) free(rpc); return NULL; } - rpc->xid = salt + time(NULL); + rpc->xid = salt + time(NULL) + getpid() << 16; salt += 0x01000000; rpc->fd = -1;