mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-28 15:40:22 +02:00
* fixed alignment issues with sparc/linux for pclose
git-svn-id: trunk@4369 -
This commit is contained in:
parent
0e8a21e84a
commit
fa44b72c78
@ -35,11 +35,14 @@ Function PClose(Var F:text) :cint;
|
|||||||
var
|
var
|
||||||
pl : ^cint;
|
pl : ^cint;
|
||||||
res : cint;
|
res : cint;
|
||||||
|
pid : cint;
|
||||||
begin
|
begin
|
||||||
fpclose(Textrec(F).Handle);
|
fpclose(Textrec(F).Handle);
|
||||||
{ 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]);
|
||||||
fpwaitpid(pl^,@res,0);
|
{ avoid alignment error on sparc }
|
||||||
|
move(pl^,pid,sizeof(pid));
|
||||||
|
fpwaitpid(pid,@res,0);
|
||||||
pclose:=res shr 8;
|
pclose:=res shr 8;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -47,11 +50,14 @@ Function PClose(Var F:file) : cint;
|
|||||||
var
|
var
|
||||||
pl : ^cint;
|
pl : ^cint;
|
||||||
res : cint;
|
res : cint;
|
||||||
|
pid : cint;
|
||||||
begin
|
begin
|
||||||
fpclose(filerec(F).Handle);
|
fpclose(filerec(F).Handle);
|
||||||
{ 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]);
|
||||||
fpwaitpid(pl^,@res,0);
|
{ avoid alignment error on sparc }
|
||||||
|
move(pl^,pid,sizeof(pid));
|
||||||
|
fpwaitpid(pid,@res,0);
|
||||||
pclose:=res shr 8;
|
pclose:=res shr 8;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user