diff options
author | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-04-08 06:57:27 +0000 |
---|---|---|
committer | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-04-08 06:57:27 +0000 |
commit | 8464d0aa2ec6239305734446c11f0f11280c1410 (patch) | |
tree | 4966eb7b6af6427612884afd25afd19131257f60 /gcc | |
parent | e9b0f2470eb7f302c335d0ab41b12d89a2e56b89 (diff) | |
download | gcc-8464d0aa2ec6239305734446c11f0f11280c1410.tar.gz |
2008-04-08 Eric Botcazou <ebotcazou@adacore.com>
* ctrl_c.c: Improve handling of ctrl-c on LynxOS and Windows.
Minor reformatting.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@134062 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ada/ctrl_c.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/gcc/ada/ctrl_c.c b/gcc/ada/ctrl_c.c index 5a5d5973f20..e9ec88de711 100644 --- a/gcc/ada/ctrl_c.c +++ b/gcc/ada/ctrl_c.c @@ -6,7 +6,7 @@ * * * C Implementation File * * * - * Copyright (C) 2002-2003, Free Software Foundation, Inc. * + * Copyright (C) 2002-2008, Free Software Foundation, Inc. * * * * GNAT is free software; you can redistribute it and/or modify it under * * terms of the GNU General Public License as published by the Free Soft- * @@ -50,7 +50,8 @@ void __gnat_uninstall_int_handler (void); /* POSIX implementation */ -#if (defined (_AIX) || defined (unix)) && !defined (__vxworks) +#if (defined (__unix__) || defined (_AIX) || defined (__APPLE__)) \ + && !defined (__vxworks) #include <signal.h> @@ -75,7 +76,12 @@ __gnat_install_int_handler (void (*proc) (void)) if (sigint_intercepted == 0) { act.sa_handler = __gnat_int_handler; +#if defined (__Lynx__) + /* LynxOS does not support SA_RESTART. */ + act.sa_flags = 0; +#else act.sa_flags = SA_RESTART; +#endif sigemptyset (&act.sa_mask); sigaction (SIGINT, &act, &original_act); } @@ -112,7 +118,10 @@ __gnat_int_handler (DWORD dwCtrlType) case CTRL_C_EVENT: case CTRL_BREAK_EVENT: if (sigint_intercepted != 0) - sigint_intercepted (); + { + sigint_intercepted (); + return TRUE; + } break; case CTRL_CLOSE_EVENT: @@ -120,6 +129,8 @@ __gnat_int_handler (DWORD dwCtrlType) case CTRL_SHUTDOWN_EVENT: break; } + + return FALSE; } void |