mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-08 12:39:39 +02:00
+ Pclose now returns exit status of process
This commit is contained in:
parent
4d271efb76
commit
0b4932253f
@ -549,8 +549,8 @@ function TellDir(p:pdir):longint;
|
|||||||
Function AssignPipe(var pipe_in,pipe_out:longint):boolean;
|
Function AssignPipe(var pipe_in,pipe_out:longint):boolean;
|
||||||
Function AssignPipe(var pipe_in,pipe_out:text):boolean;
|
Function AssignPipe(var pipe_in,pipe_out:text):boolean;
|
||||||
Function AssignPipe(var pipe_in,pipe_out:file):boolean;
|
Function AssignPipe(var pipe_in,pipe_out:file):boolean;
|
||||||
Procedure PClose(Var F:text);
|
Function PClose(Var F:text) : longint;
|
||||||
Procedure PClose(Var F:file);
|
Function PClose(Var F:file) : longint;
|
||||||
Procedure POpen(var F:text;const Prog:String;rw:char);
|
Procedure POpen(var F:text;const Prog:String;rw:char);
|
||||||
Procedure POpen(var F:file;const Prog:String;rw:char);
|
Procedure POpen(var F:file;const Prog:String;rw:char);
|
||||||
|
|
||||||
@ -1896,31 +1896,35 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
Procedure PClose(Var F:text);
|
Function PClose(Var F:text) :longint;
|
||||||
var
|
var
|
||||||
sr : syscallregs;
|
sr : syscallregs;
|
||||||
pl : ^longint;
|
pl : ^longint;
|
||||||
|
res : longint;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
sr.reg2:=Textrec(F).Handle;
|
sr.reg2:=Textrec(F).Handle;
|
||||||
SysCall (syscall_nr_close,sr);
|
SysCall (syscall_nr_close,sr);
|
||||||
{ closed our side, Now wait for the other - this appears to be needed ?? }
|
{ closed our side, Now wait for the other - this appears to be needed ?? }
|
||||||
pl:=@(textrec(f).userdata[2]);
|
pl:=@(textrec(f).userdata[2]);
|
||||||
waitpid(pl^,nil,0);
|
waitpid(pl^,@res,0);
|
||||||
|
pclose:=res shr 8;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
Procedure PClose(Var F:file);
|
Function PClose(Var F:file) : longint;
|
||||||
var
|
var
|
||||||
sr : syscallregs;
|
sr : syscallregs;
|
||||||
pl : ^longint;
|
pl : ^longint;
|
||||||
|
res : longint;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
sr.reg2:=FileRec(F).Handle;
|
sr.reg2:=FileRec(F).Handle;
|
||||||
SysCall (Syscall_nr_close,sr);
|
SysCall (Syscall_nr_close,sr);
|
||||||
{ closed our side, Now wait for the other - this appears to be needed ?? }
|
{ closed our side, Now wait for the other - this appears to be needed ?? }
|
||||||
pl:=@(filerec(f).userdata[2]);
|
pl:=@(filerec(f).userdata[2]);
|
||||||
waitpid(pl^,nil,0);
|
waitpid(pl^,@res,0);
|
||||||
|
pclose:=res shr 8;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
@ -3158,7 +3162,10 @@ End.
|
|||||||
|
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.4 1998-04-07 13:08:29 michael
|
Revision 1.5 1998-04-10 15:23:03 michael
|
||||||
|
+ Pclose now returns exit status of process
|
||||||
|
|
||||||
|
Revision 1.4 1998/04/07 13:08:29 michael
|
||||||
+ Added flock for file locking
|
+ Added flock for file locking
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user