diff options
author | Volker Lendecke <vlendec@samba.org> | 2007-07-04 22:30:25 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 12:23:47 -0500 |
commit | 254e1ad28b095b54ac3df3c840c6a7f3b27da203 (patch) | |
tree | 024125b962cd3ace66d8cdd187cb7c300d3a662c /source3 | |
parent | 824b3f82acd09315a68cc7f66a6bbab4f50f6eb7 (diff) | |
download | samba-254e1ad28b095b54ac3df3c840c6a7f3b27da203.tar.gz samba-254e1ad28b095b54ac3df3c840c6a7f3b27da203.tar.bz2 samba-254e1ad28b095b54ac3df3c840c6a7f3b27da203.zip |
r23710: Remove some code duplication, we do have a random number generator
(This used to be commit afd7febd980bb000f81d5251d03d500cb43c39f4)
Diffstat (limited to 'source3')
-rw-r--r-- | source3/libsmb/namequery.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/source3/libsmb/namequery.c b/source3/libsmb/namequery.c index 0826bc5218..bde24b4b90 100644 --- a/source3/libsmb/namequery.c +++ b/source3/libsmb/namequery.c @@ -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()); - } - - trn_id = sys_random(); + generate_random_buffer((uint8 *)&id, sizeof(id)); - return trn_id % (unsigned)0x7FFF; + return id % (unsigned)0x7FFF; } /**************************************************************************** |