From: Jan Dubois Date: Mon, 16 Apr 2007 17:52:25 +0000 (-0700) Subject: Allow sending SIGINT to child processes on Windows *if* they are running Perl X-Git-Tag: accepted/trunk/20130322.191538~15460 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0a311364e00e9bf5b4fcb140ade49b02e46833dd;p=platform%2Fupstream%2Fperl.git Allow sending SIGINT to child processes on Windows *if* they are running Perl From: "Jan Dubois" Message-ID: <01e301c7808a$ac0cca30$04265e90$@com> p4raw-id: //depot/perl@30979 --- diff --git a/win32/win32.c b/win32/win32.c index 55239e5..c69c2a7 100644 --- a/win32/win32.c +++ b/win32/win32.c @@ -4910,6 +4910,16 @@ Perl_sys_intern_init(pTHX) /* Force C runtime signal stuff to set its console handler */ signal(SIGINT,win32_csighandler); signal(SIGBREAK,win32_csighandler); + + /* We spawn asynchronous processes with the CREATE_NEW_PROCESS_GROUP + * flag. This has the side-effect of disabling Ctrl-C events in all + * processes in this group. At least on Windows NT and later we + * can re-enable Ctrl-C handling by calling SetConsoleCtrlHandler() + * with a NULL handler. This is not valid on Windows 9X. + */ + if (IsWinNT()) + SetConsoleCtrlHandler(NULL,FALSE); + /* Push our handler on top */ SetConsoleCtrlHandler(win32_ctrlhandler,TRUE); }