Selaa lähdekoodia

* removed some old 1.0.x ->2.0.x transitional code (executeprocess)

git-svn-id: trunk@12238 -
marco 16 vuotta sitten
vanhempi
commit
52bb5ac229
1 muutettua tiedostoa jossa 3 lisäystä ja 16 poistoa
  1. 3 16
      rtl/unix/sysutils.pp

+ 3 - 16
rtl/unix/sysutils.pp

@@ -866,7 +866,6 @@ begin
 end;
 end;
 
 
 
 
-{$define FPC_USE_FPEXEC}  // leave the old code under IFDEF for a while.
 function ExecuteProcess(Const Path: AnsiString; Const ComLine: AnsiString):integer;
 function ExecuteProcess(Const Path: AnsiString; Const ComLine: AnsiString):integer;
 var
 var
   pid    : longint;
   pid    : longint;
@@ -879,7 +878,8 @@ Begin
     so that long filenames will always be accepted. But don't
     so that long filenames will always be accepted. But don't
     do it if there are already double quotes!
     do it if there are already double quotes!
   }
   }
-  {$ifdef FPC_USE_FPEXEC}       // Only place we still parse
+
+   // Only place we still parse
    cmdline2:=nil;
    cmdline2:=nil;
    if Comline<>'' Then
    if Comline<>'' Then
      begin
      begin
@@ -896,14 +896,7 @@ Begin
        cmdline2^:=pchar(Path);
        cmdline2^:=pchar(Path);
        cmdline2[1]:=nil;
        cmdline2[1]:=nil;
      end;
      end;
-  {$else}
-  if Pos ('"', Path) = 0 then
-    CommandLine := '"' + Path + '"'
-  else
-    CommandLine := Path;
-  if ComLine <> '' then
-    CommandLine := Commandline + ' ' + ComLine;
-  {$endif}
+
   {$ifdef USE_VFORK}
   {$ifdef USE_VFORK}
   pid:=fpvFork;
   pid:=fpvFork;
   {$else USE_VFORK}
   {$else USE_VFORK}
@@ -912,11 +905,7 @@ Begin
   if pid=0 then
   if pid=0 then
    begin
    begin
    {The child does the actual exec, and then exits}
    {The child does the actual exec, and then exits}
-    {$ifdef FPC_USE_FPEXEC}
       fpexecv(pchar(pointer(Path)),Cmdline2);
       fpexecv(pchar(pointer(Path)),Cmdline2);
-    {$else}
-      Execl(CommandLine);
-    {$endif}
      { If the execve fails, we return an exitvalue of 127, to let it be known}
      { If the execve fails, we return an exitvalue of 127, to let it be known}
      fpExit(127);
      fpExit(127);
    end
    end
@@ -931,10 +920,8 @@ Begin
   { We're in the parent, let's wait. }
   { We're in the parent, let's wait. }
   result:=WaitProcess(pid); // WaitPid and result-convert
   result:=WaitProcess(pid); // WaitPid and result-convert
 
 
-  {$ifdef FPC_USE_FPEXEC}
   if Comline<>'' Then
   if Comline<>'' Then
     freemem(cmdline2);
     freemem(cmdline2);
-  {$endif}
 
 
   if (result<0) or (result=127) then
   if (result<0) or (result=127) then
     begin
     begin