diff options
author | shirosaki <shirosaki@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-01-28 00:51:40 +0000 |
---|---|---|
committer | shirosaki <shirosaki@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-01-28 00:51:40 +0000 |
commit | bb65920642330cb375b3649496dca95e27aee04b (patch) | |
tree | 6c13c993e314328374780e68bcfc55d67d69eaac /win32 | |
parent | 494fd237f00f166cf024a51fd04e064fc94e0f82 (diff) |
* test/ruby/test_thread.rb
(TestThreadGroup#test_thread_timer_and_interrupt): skip exit status
assertion because we cannot get signal status on Windows.
* win32/win32.c (CreateChild): create process group to receive the
signal by GenerateConsoleCtrlEvent().
* win32/win32.c (kill): use CTRL_BREAK_EVENT instead of CTRL_C_EVENT
if a process group is specified. CTRL_C_EVENT signal cannot be
generated for process groups for the specification.
[ruby-dev:45149] [Bug #5812]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34389 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'win32')
-rw-r--r-- | win32/win32.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/win32/win32.c b/win32/win32.c index 7cb1b31df6..9922fa5b14 100644 --- a/win32/win32.c +++ b/win32/win32.c @@ -1132,7 +1132,7 @@ CreateChild(const WCHAR *cmd, const WCHAR *prog, SECURITY_ATTRIBUTES *psa, aStartupInfo.hStdError = GetStdHandle(STD_ERROR_HANDLE); } - dwCreationFlags = (NORMAL_PRIORITY_CLASS); + dwCreationFlags = (CREATE_NEW_PROCESS_GROUP | NORMAL_PRIORITY_CLASS); if (lstrlenW(cmd) > 32767) { child->pid = 0; /* release the slot */ @@ -4094,7 +4094,13 @@ kill(int pid, int sig) case SIGINT: RUBY_CRITICAL({ - if (!GenerateConsoleCtrlEvent(CTRL_C_EVENT, (DWORD)pid)) { + DWORD ctrlEvent = CTRL_C_EVENT; + if (pid != 0) { + /* CTRL+C signal cannot be generated for process groups. + * Instead, we use CTRL+BREAK signal. */ + ctrlEvent = CTRL_BREAK_EVENT; + } + if (!GenerateConsoleCtrlEvent(ctrlEvent, (DWORD)pid)) { if ((err = GetLastError()) == 0) errno = EPERM; else |