mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-16 10:19:30 +02:00
* Handle Control-C exception more cleanly
This commit is contained in:
parent
482d781af3
commit
2ec108a9c7
@ -75,7 +75,7 @@ Function CatchSignal(Sig : longint):longint;
|
||||
begin
|
||||
case Sig of
|
||||
SIGINT :
|
||||
raise Exception.Create('Ctrl-C Signaled!');
|
||||
raise EControlCAbort.Create;
|
||||
end;
|
||||
{$ifndef unix}
|
||||
CatchSignal:=0;
|
||||
@ -94,7 +94,10 @@ end.
|
||||
|
||||
{
|
||||
$Log$
|
||||
Revision 1.23 2005-02-14 17:13:06 peter
|
||||
Revision 1.24 2005-02-15 19:15:45 peter
|
||||
* Handle Control-C exception more cleanly
|
||||
|
||||
Revision 1.23 2005/02/14 17:13:06 peter
|
||||
* truncate log
|
||||
|
||||
Revision 1.22 2005/01/31 21:30:56 olle
|
||||
|
@ -410,11 +410,17 @@ begin
|
||||
end;
|
||||
except
|
||||
|
||||
Message(general_e_compilation_aborted);
|
||||
|
||||
DoneVerbose;
|
||||
|
||||
Raise;
|
||||
on EControlCAbort do
|
||||
begin
|
||||
Message(general_e_compilation_aborted);
|
||||
DoneVerbose;
|
||||
end;
|
||||
on Exception do
|
||||
begin
|
||||
Message(general_e_compilation_aborted);
|
||||
DoneVerbose;
|
||||
Raise;
|
||||
end;
|
||||
end;
|
||||
{$ifdef SHOWUSEDMEM}
|
||||
{$ifdef HASGETHEAPSTATUS}
|
||||
@ -435,7 +441,10 @@ end;
|
||||
end.
|
||||
{
|
||||
$Log$
|
||||
Revision 1.56 2005-02-14 17:13:06 peter
|
||||
Revision 1.57 2005-02-15 19:15:45 peter
|
||||
* Handle Control-C exception more cleanly
|
||||
|
||||
Revision 1.56 2005/02/14 17:13:06 peter
|
||||
* truncate log
|
||||
|
||||
Revision 1.55 2005/02/13 20:11:16 peter
|
||||
|
@ -27,6 +27,7 @@ unit verbose;
|
||||
interface
|
||||
|
||||
uses
|
||||
sysutils,
|
||||
cutils,
|
||||
globals,finput,
|
||||
cmsgs;
|
||||
@ -67,6 +68,11 @@ interface
|
||||
const
|
||||
msgfilename : string = '';
|
||||
|
||||
type
|
||||
EControlCAbort=class(Exception)
|
||||
constructor Create;
|
||||
end;
|
||||
|
||||
procedure SetRedirectFile(const fn:string);
|
||||
function SetVerbosity(const s:string):boolean;
|
||||
procedure PrepareReport;
|
||||
@ -106,6 +112,7 @@ interface
|
||||
procedure DoneVerbose;
|
||||
|
||||
|
||||
|
||||
implementation
|
||||
|
||||
uses
|
||||
@ -114,6 +121,17 @@ implementation
|
||||
var
|
||||
compiling_module : tmodulebase;
|
||||
|
||||
|
||||
{****************************************************************************
|
||||
Control-C Exception
|
||||
****************************************************************************}
|
||||
|
||||
constructor EControlCAbort.Create;
|
||||
begin
|
||||
inherited Create('Ctrl-C Signaled!');
|
||||
end;
|
||||
|
||||
|
||||
{****************************************************************************
|
||||
Extra Handlers for default compiler
|
||||
****************************************************************************}
|
||||
@ -876,7 +894,10 @@ finalization
|
||||
end.
|
||||
{
|
||||
$Log$
|
||||
Revision 1.38 2005-02-14 17:13:09 peter
|
||||
Revision 1.39 2005-02-15 19:15:45 peter
|
||||
* Handle Control-C exception more cleanly
|
||||
|
||||
Revision 1.38 2005/02/14 17:13:09 peter
|
||||
* truncate log
|
||||
|
||||
Revision 1.37 2005/02/07 17:25:28 peter
|
||||
|
Loading…
Reference in New Issue
Block a user