mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-18 18:09:12 +02:00
* default sharing mode changed to deny all (compatibility)
This commit is contained in:
parent
bc377c69ce
commit
45b2819768
@ -473,8 +473,6 @@ procedure do_open(var f;p:pchar;flags:longint);
|
|||||||
when (flags and $10000) there is no check for close (needed for textfiles)
|
when (flags and $10000) there is no check for close (needed for textfiles)
|
||||||
}
|
}
|
||||||
|
|
||||||
(* var oflags:byte;
|
|
||||||
*)
|
|
||||||
var Action: longint;
|
var Action: longint;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
@ -495,8 +493,6 @@ begin
|
|||||||
{ reset file handle }
|
{ reset file handle }
|
||||||
filerec(f).handle := UnusedHandle;
|
filerec(f).handle := UnusedHandle;
|
||||||
Action := 0;
|
Action := 0;
|
||||||
(* oflags:=2;
|
|
||||||
*)
|
|
||||||
{ convert filemode to filerec modes }
|
{ convert filemode to filerec modes }
|
||||||
case (flags and 3) of
|
case (flags and 3) of
|
||||||
0 : filerec(f).mode:=fminput;
|
0 : filerec(f).mode:=fminput;
|
||||||
@ -505,17 +501,6 @@ begin
|
|||||||
end;
|
end;
|
||||||
if (flags and $1000)<>0 then
|
if (flags and $1000)<>0 then
|
||||||
Action := $50000; (* Create / replace *)
|
Action := $50000; (* Create / replace *)
|
||||||
(* begin
|
|
||||||
filerec(f).mode:=fmoutput;
|
|
||||||
oflags:=2;
|
|
||||||
end
|
|
||||||
else
|
|
||||||
if (flags and $100)<>0 then
|
|
||||||
begin
|
|
||||||
filerec(f).mode:=fmoutput;
|
|
||||||
oflags:=2;
|
|
||||||
end;
|
|
||||||
*)
|
|
||||||
{ empty name is special }
|
{ empty name is special }
|
||||||
if p[0]=#0 then
|
if p[0]=#0 then
|
||||||
begin
|
begin
|
||||||
@ -534,14 +519,9 @@ begin
|
|||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
Action := Action or (Flags and $FF);
|
Action := Action or (Flags and $FF);
|
||||||
(* DenyNone if sharing not specified. *)
|
(* DenyAll if sharing not specified. *)
|
||||||
if Flags and 112 = 0 then
|
if Flags and 112 = 0 then
|
||||||
(* begin
|
Action := Action or 16;
|
||||||
if Flags and 3 = 0 then*)
|
|
||||||
Action := Action or 64;
|
|
||||||
(* else
|
|
||||||
Action := Action or 32;
|
|
||||||
end;*)
|
|
||||||
asm
|
asm
|
||||||
movl $0x7f2b, %eax
|
movl $0x7f2b, %eax
|
||||||
movl Action, %ecx
|
movl Action, %ecx
|
||||||
@ -562,43 +542,14 @@ begin
|
|||||||
movl Action, %ecx
|
movl Action, %ecx
|
||||||
movl p, %edx
|
movl p, %edx
|
||||||
call syscall
|
call syscall
|
||||||
jnc .LOPEN2
|
cmpl $0xffffffff, %eax
|
||||||
movw %ax, InOutRes;
|
jnz .LOPEN1
|
||||||
|
movw %cx, InOutRes
|
||||||
movw UnusedHandle, %ax
|
movw UnusedHandle, %ax
|
||||||
.LOPEN2:
|
.LOPEN2:
|
||||||
movl f,%edx
|
movl f,%edx
|
||||||
movw %ax,(%edx)
|
movw %ax,(%edx)
|
||||||
end;
|
end;
|
||||||
(*
|
|
||||||
if (flags and $1000)<>0 then
|
|
||||||
{Use create function.}
|
|
||||||
asm
|
|
||||||
movb $0x3c,%ah
|
|
||||||
movl p,%edx
|
|
||||||
xorw %cx,%cx
|
|
||||||
call syscall
|
|
||||||
jnc .LOPEN1
|
|
||||||
movw %ax,inoutres;
|
|
||||||
movw $0xffff,%ax
|
|
||||||
.LOPEN1:
|
|
||||||
movl f,%edx
|
|
||||||
movw %ax,(%edx)
|
|
||||||
end
|
|
||||||
else
|
|
||||||
{Use open function.}
|
|
||||||
asm
|
|
||||||
movb $0x3d,%ah
|
|
||||||
movb oflags,%al
|
|
||||||
movl p,%edx
|
|
||||||
call syscall
|
|
||||||
jnc .LOPEN2
|
|
||||||
movw %ax,inoutres;
|
|
||||||
movw $0xffff,%ax
|
|
||||||
.LOPEN2:
|
|
||||||
movl f,%edx
|
|
||||||
movw %ax,(%edx)
|
|
||||||
end;
|
|
||||||
*)
|
|
||||||
{ for systems that have more handles }
|
{ for systems that have more handles }
|
||||||
if FileRec (F).Handle > FileHandleCount then
|
if FileRec (F).Handle > FileHandleCount then
|
||||||
FileHandleCount := FileRec (F).Handle;
|
FileHandleCount := FileRec (F).Handle;
|
||||||
@ -631,7 +582,6 @@ asm
|
|||||||
dec eax
|
dec eax
|
||||||
@IsDevEnd:
|
@IsDevEnd:
|
||||||
end;
|
end;
|
||||||
(* do_isdevice := (Handle <= 5);*)
|
|
||||||
{$ASMMODE ATT}
|
{$ASMMODE ATT}
|
||||||
|
|
||||||
|
|
||||||
@ -856,7 +806,10 @@ begin
|
|||||||
end.
|
end.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.32 2000-06-11 09:47:57 hajny
|
Revision 1.33 2000-07-09 17:05:24 hajny
|
||||||
|
* default sharing mode changed to deny all (compatibility)
|
||||||
|
|
||||||
|
Revision 1.32 2000/06/11 09:47:57 hajny
|
||||||
* error handling and sharing corrected
|
* error handling and sharing corrected
|
||||||
|
|
||||||
Revision 1.31 2000/06/05 18:53:30 hajny
|
Revision 1.31 2000/06/05 18:53:30 hajny
|
||||||
|
Loading…
Reference in New Issue
Block a user