diff options
Diffstat (limited to 'desktop/source/deployment/misc/lockfile.cxx')
-rw-r--r-- | desktop/source/deployment/misc/lockfile.cxx | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/desktop/source/deployment/misc/lockfile.cxx b/desktop/source/deployment/misc/lockfile.cxx index 96d9dce076db..1f3d2f2a86ce 100644 --- a/desktop/source/deployment/misc/lockfile.cxx +++ b/desktop/source/deployment/misc/lockfile.cxx @@ -24,6 +24,7 @@ #else #include <windows.h> #endif +#include <comphelper/random.hxx> #include <sal/types.h> #include <osl/file.hxx> #include <osl/socket.hxx> @@ -33,7 +34,6 @@ #include "lockfile.hxx" - using namespace ::osl; using namespace ::rtl; using namespace ::utl; @@ -85,11 +85,9 @@ namespace desktop { // generate ID const int nIdBytes = 16; char tmpId[nIdBytes*2+1]; - time_t t; - srand( (unsigned)(t = time( NULL )) ); - int tmpByte = 0; + time_t t = time(NULL); for (int i = 0; i<nIdBytes; i++) { - tmpByte = rand( ) % 0xFF; + int tmpByte = comphelper::rng::uniform_int_distribution(0, 0xFF); sprintf( tmpId+i*2, "%02X", tmpByte ); } tmpId[nIdBytes*2]=0x00; |