Browse Source

* Fix bug #31555, disbablefile locking

git-svn-id: trunk@35611 -
michael 8 years ago
parent
commit
5bbf299c22
2 changed files with 4 additions and 4 deletions
  1. 1 1
      rtl/bsd/suuid.inc
  2. 3 3
      rtl/linux/suuid.inc

+ 1 - 1
rtl/bsd/suuid.inc

@@ -51,7 +51,7 @@ Var
   
 begin
   P:=@Buf;
-  fd:=FileOpen(RandomDevice,fmOpenRead);
+  fd:=FileOpen(RandomDevice,fmOpenRead or fmShareDenyNone);
   Result:=(fd>=0);
   if Result then
     Try

+ 3 - 3
rtl/linux/suuid.inc

@@ -28,7 +28,7 @@ Var
   
 begin
   P:=@Buf;
-  fd:=FileOpen('/dev/urandom',fmOpenRead);
+  fd:=FileOpen('/dev/urandom',fmOpenRead or fmShareDenyNone);
   if (fd>=0) then
     Try
       While (NBytes>0) do
@@ -58,7 +58,7 @@ Var
   S : String;
   
 begin
-  fd:=FileOpen(KernelUUID,fmOpenRead);
+  fd:=FileOpen(KernelUUID,fmOpenRead or fmShareDenyNone);
   Result:=(Fd>=0);
   if Result then
     try
@@ -76,7 +76,7 @@ Function SysCreateGUID(out GUID : TGUID) : Integer;
 
 begin
   if not CreateKernelGUID(Guid) then
-    GetRandomBytes(GUID,SizeOf(Guid));  
+    GetURandomBytes(GUID,SizeOf(Guid));  
   Result:=0;    
 end;