Recent

Author Topic: [SOLVED] Clean up at Function TProcess.WaitOnExit : Boolean;  (Read 498 times)

lagprogramming

  • Sr. Member
  • ****
  • Posts: 403
packages/fcl-process/src/unix/process.inc has the following function:
Code: Pascal  [Select][+][-]
  1. Function TProcess.WaitOnExit : Boolean;
  2.  
  3. Var
  4.   R : Dword;
  5.  
  6. begin
  7.   if FRunning then
  8.     fexitcode:=waitprocess(handle);
  9.   Result:=(fexitcode>=0);
  10.   FRunning:=False;
  11. end;
Variable R is declared but never used.
The following patch removes it.
Code: Pascal  [Select][+][-]
  1. diff --git a/packages/fcl-process/src/unix/process.inc b/packages/fcl-process/src/unix/process.inc
  2. index 442c68411b..d99fef48e9 100644
  3. --- a/packages/fcl-process/src/unix/process.inc
  4. +++ b/packages/fcl-process/src/unix/process.inc
  5. @@ -455,9 +455,6 @@ procedure TProcess.CloseProcessHandles;
  6.  
  7.  Function TProcess.WaitOnExit : Boolean;
  8.  
  9. -Var
  10. -  R : Dword;
  11. -
  12.  begin
  13.    if FRunning then
  14.      fexitcode:=waitprocess(handle);
« Last Edit: July 13, 2023, 11:16:35 am by lagprogramming »

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11266
  • FPC developer.
Re: Clean up at Function TProcess.WaitOnExit : Boolean;
« Reply #1 on: July 13, 2023, 09:45:27 am »
Done, thanks

 

TinyPortal © 2005-2018