Explorar o código

Merged revisions 4369 via svnmerge from
svn+ssh://[email protected]/FPC/svn/fpc/trunk

........
r4369 | jonas | 2006-08-06 13:51:11 +0200 (Sun, 06 Aug 2006) | 2 lines

* fixed alignment issues with sparc/linux for pclose

........

git-svn-id: branches/fixes_2_0@4370 -

Jonas Maebe %!s(int64=19) %!d(string=hai) anos
pai
achega
dc13ba25e9
Modificáronse 1 ficheiros con 8 adicións e 2 borrados
  1. 8 2
      rtl/linux/unxfunc.inc

+ 8 - 2
rtl/linux/unxfunc.inc

@@ -35,11 +35,14 @@ Function PClose(Var F:text) :cint;
 var
   pl  : ^cint;
   res : cint;
+  pid : cint;
 begin
   fpclose(Textrec(F).Handle);
 { closed our side, Now wait for the other - this appears to be needed ?? }
   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;
 end;
 
@@ -47,11 +50,14 @@ Function PClose(Var F:file) : cint;
 var
   pl : ^cint;
   res : cint;
+  pid : cint;
 begin
   fpclose(filerec(F).Handle);
 { closed our side, Now wait for the other - this appears to be needed ?? }
   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;
 end;