From 36d06688c8fce51f50155c84d4f6b69f87cbd595 Mon Sep 17 00:00:00 2001 From: Basile Burg Date: Sat, 3 Sep 2016 17:32:51 +0200 Subject: [PATCH] use ExitCode and not ExitStatus --- src/ce_dfmt.pas | 4 ++-- src/ce_dubproject.pas | 2 +- src/ce_main.pas | 9 +++++---- src/ce_nativeproject.pas | 12 +++++++----- src/ce_synmemo.pas | 2 +- 5 files changed, 16 insertions(+), 13 deletions(-) diff --git a/src/ce_dfmt.pas b/src/ce_dfmt.pas index 8d6f6052..481d9e9f 100644 --- a/src/ce_dfmt.pas +++ b/src/ce_dfmt.pas @@ -302,8 +302,6 @@ begin inp := fDoc.Lines.Text; prc.Input.Write(inp[1], inp.length); prc.CloseInput; - while prc.Running do - sleep(1); try str := TStringList.Create; processOutputToStrings(prc,str); @@ -314,6 +312,8 @@ begin except fDoc.Lines.Assign(fBackup); end; + while prc.Running do + sleep(1); finally prc.free; str.free; diff --git a/src/ce_dubproject.pas b/src/ce_dubproject.pas index 2aa448f5..3d4c3d9f 100644 --- a/src/ce_dubproject.pas +++ b/src/ce_dubproject.pas @@ -567,7 +567,7 @@ begin dubProcOutput(proc); msgs := getMessageDisplay; prjname := shortenPath(filename); - fCompiled := fDubProc.ExitStatus = 0; + fCompiled := fDubProc.ExitCode = 0; if fCompiled then msgs.message(prjname + ' has been successfully compiled', self as ICECommonProject, amcProj, amkInf) diff --git a/src/ce_main.pas b/src/ce_main.pas index 80e593bd..1205439b 100644 --- a/src/ce_main.pas +++ b/src/ce_main.pas @@ -2487,9 +2487,9 @@ begin inph := EntitiesConnector.getSingleService('ICEProcInputHandler'); if (inph <> nil) then (inph as ICEProcInputHandler).removeProcess(proc); - if (proc.ExitStatus <> 0) then + if (proc.ExitCode <> 0) then fMsgs.message(format('error: the process (%s) has returned the signal %d', - [proc.Executable, proc.ExitStatus]), fDoc, amcEdit, amkErr); + [proc.Executable, proc.ExitCode]), fDoc, amcEdit, amkErr); end; procedure TCEMainForm.actSetRunnableSwExecute(Sender: TObject); @@ -2632,7 +2632,7 @@ begin application.ProcessMessages; if not asObj then sysutils.DeleteFile(fname + objExt); - if (dmdProc.ExitStatus = 0) then + if (dmdProc.ExitCode = 0) then begin result := true; fMsgs.message(shortenPath(fDoc.fileName, 25) + ' successfully compiled', @@ -2640,7 +2640,7 @@ begin end else begin fMsgs.message(format('error: the process (%s) has returned the signal %d', - [dmdproc.Executable, dmdproc.ExitStatus]), fDoc, amcEdit, amkErr); + [dmdproc.Executable, dmdproc.ExitCode]), fDoc, amcEdit, amkErr); fMsgs.message(shortenPath(fDoc.fileName, 25) + ' has not been compiled', fDoc, amcEdit, amkErr); end; @@ -2802,6 +2802,7 @@ begin prc.Parameters.Add('--skipTests'); prc.Execute; processOutputToStrings(prc, lst); + while prc.Running do; for msg in lst do fMsgs.message(msg, fDoc, amcEdit, amkAuto); finally diff --git a/src/ce_nativeproject.pas b/src/ce_nativeproject.pas index 24fe3968..431105e5 100644 --- a/src/ce_nativeproject.pas +++ b/src/ce_nativeproject.pas @@ -666,9 +666,11 @@ begin lst.Delete(0); prc.Parameters.Assign(lst); prc.Execute; - com := prc.ExitCode = 0; lst.Clear; processOutputToStrings(prc, lst); + while prc.Running do + sleep(1); + com := prc.ExitCode = 0; for j := 0 to lst.Count -1 do getMessageDisplay.message(lst[j], self as ICECommonProject, amcProj, amkAuto); finally @@ -703,7 +705,7 @@ begin if poUsePipes in prc.Options then runProcOutput(prc); finally - result := prc.ExitStatus = 0; + result := prc.ExitCode = 0; prc.Free; end; end; @@ -847,9 +849,9 @@ begin getprocInputHandler.removeProcess(TProcess(sender)); SetCurrentDirUTF8(fRunnerOldCwd); // - if (proc.ExitStatus <> 0) then + if (proc.ExitCode <> 0) then msgs.message(format('error: the process (%s) has returned the signal %d', - [proc.Executable, proc.ExitStatus]), self as ICECommonProject, amcProj, amkErr); + [proc.Executable, proc.ExitCode]), self as ICECommonProject, amcProj, amkErr); end; end; @@ -878,7 +880,7 @@ begin compProcOutput(proc); msgs := getMessageDisplay; prjname := shortenPath(filename); - fCompiled := fCompilProc.ExitStatus = 0; + fCompiled := fCompilProc.ExitCode = 0; updateOutFilename; if fCompiled then msgs.message(prjname + ' has been successfully compiled', diff --git a/src/ce_synmemo.pas b/src/ce_synmemo.pas index b1ecba4c..58648705 100644 --- a/src/ce_synmemo.pas +++ b/src/ce_synmemo.pas @@ -1500,9 +1500,9 @@ begin prc.Execute; prc.Input.Write(src[1], src.length); prc.CloseInput; + prc.Output.Read(res, 1); while prc.Running do sleep(1); - prc.Output.Read(res, 1); finally prc.Free; end;