mirror of
https://github.com/samba-team/samba.git
synced 2025-01-22 22:04:08 +03:00
r23710: Remove some code duplication, we do have a random number generator
(This used to be commit afd7febd980bb000f81d5251d03d500cb43c39f4)
This commit is contained in:
parent
824b3f82ac
commit
254e1ad28b
@ -145,15 +145,11 @@ char *saf_fetch( const char *domain )
|
||||
|
||||
static int generate_trn_id(void)
|
||||
{
|
||||
static int trn_id;
|
||||
uint16 id;
|
||||
|
||||
if (trn_id == 0) {
|
||||
sys_srandom(sys_getpid());
|
||||
}
|
||||
generate_random_buffer((uint8 *)&id, sizeof(id));
|
||||
|
||||
trn_id = sys_random();
|
||||
|
||||
return trn_id % (unsigned)0x7FFF;
|
||||
return id % (unsigned)0x7FFF;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
|
Loading…
x
Reference in New Issue
Block a user