Selaa lähdekoodia

* fixed linker exit code detection in case of useshell

git-svn-id: trunk@5138 -
Jonas Maebe 19 vuotta sitten
vanhempi
commit
0909d46626
1 muutettua tiedostoa jossa 11 lisäystä ja 10 poistoa
  1. 11 10
      compiler/link.pas

+ 11 - 10
compiler/link.pas

@@ -614,22 +614,23 @@ Implementation
          begin
            FlushOutput;
            if useshell then
-             exitcode := shell(maybequoted(command)+' '+para)
+             exitcode:=shell(maybequoted(command)+' '+para)
            else
-           try
-             if ExecuteProcess(command,para) <> 0
-             then begin
-               Message(exec_e_error_while_linking);
-               current_settings.globalswitches:=current_settings.globalswitches+[cs_link_nolink];
-               DoExec:=false;
+             try
+               exitcode:=ExecuteProcess(command,para);
+             except on E:EOSError do
+               begin
+                 Message(exec_e_cant_call_linker);
+                 current_settings.globalswitches:=current_settings.globalswitches+[cs_link_nolink];
+                 DoExec:=false;
+               end;
              end;
-           except on E:EOSError do
+           if (exitcode<>0) then
              begin
-               Message(exec_e_cant_call_linker);
+               Message(exec_e_error_while_linking);
                current_settings.globalswitches:=current_settings.globalswitches+[cs_link_nolink];
                DoExec:=false;
              end;
-           end
          end;
       { Update asmres when externmode is set }
         if cs_link_nolink in current_settings.globalswitches then