浏览代码

+ Changed Exception to EProcess

git-svn-id: trunk@2923 -
michael 19 年之前
父节点
当前提交
7f5b9e5c00
共有 4 个文件被更改,包括 7 次插入5 次删除
  1. 2 0
      fcl/inc/process.pp
  2. 3 3
      fcl/unix/process.inc
  3. 1 1
      fcl/win32/process.inc
  4. 1 1
      fcl/wince/process.inc

+ 2 - 0
fcl/inc/process.pp

@@ -130,6 +130,8 @@ Type
     Property WindowWidth : Cardinal Read dwXSize Write SetWindowWidth;
     Property FillAttribute : Cardinal read FFillAttribute Write FFillAttribute;
   end;
+  
+  EProcess = Class(Exception);
 
 implementation
 

+ 3 - 3
fcl/unix/process.inc

@@ -139,7 +139,7 @@ begin
   if (P.ApplicationName='') then
     begin
     If (P.CommandLine='') then
-      Raise Exception.Create(SNoCommandline);
+      Raise EProcess.Create(SNoCommandline);
     Cmd:=P.CommandLine;
     end
   else
@@ -204,7 +204,7 @@ Procedure CreatePipes(Var HI,HO,HE : TPipePair; CE : Boolean);
 
    begin
     If not CreatePipeHandles(P[peRead],P[peWrite]) then
-      Raise Exception.Create('Failed to create pipes');
+      Raise EProcess.Create('Failed to create pipes');
    end;
 
   Procedure ClosePair(Var P : TPipePair);
@@ -268,7 +268,7 @@ begin
           PName:=FileSearch(Pname,fpgetenv('PATH'));
         Pid:=fpfork;
         if Pid<0 then
-          Raise Exception.Create('Failed to Fork process');
+          Raise EProcess.Create('Failed to Fork process');
         if (PID>0) then
           begin
           // Parent process. Copy process information.

+ 1 - 1
fcl/win32/process.inc

@@ -202,7 +202,7 @@ begin
       If Not CreateProcess (PName,PCommandLine,@FProcessAttributes,@FThreadAttributes,
                    FInheritHandles,FCreationFlags,FEnv,PDir,FStartupInfo,
                    fProcessInformation) then
-        Raise Exception.CreateFmt('Failed to execute %s : %d',[FCommandLine,GetLastError]);
+        Raise EProcess.CreateFmt('Failed to execute %s : %d',[FCommandLine,GetLastError]);
       FProcessHandle:=FProcessInformation.hProcess;
       FThreadHandle:=FProcessInformation.hThread;
       FProcessID:=FProcessINformation.dwProcessID;

+ 1 - 1
fcl/wince/process.inc

@@ -202,7 +202,7 @@ begin
       If Not CreateProcess (PName,PCommandLine,@FProcessAttributes,@FThreadAttributes,
                    FInheritHandles,FCreationFlags,FEnv,PDir,@FStartupInfo,
                    fProcessInformation) then
-        Raise Exception.CreateFmt('Failed to execute %s : %d',[FCommandLine,GetLastError]);
+        Raise EProcess.CreateFmt('Failed to execute %s : %d',[FCommandLine,GetLastError]);
       FProcessHandle:=FProcessInformation.hProcess;
       FThreadHandle:=FProcessInformation.hThread;
       FProcessID:=FProcessINformation.dwProcessID;