merge revision(s) 34040,34051,34063,34389,34402,34403:

------------------------------------------------------------------------
r34040 | naruse | 2011-12-14 14:42:34 +0900 (Wed, 14 Dec 2011) | 1 line

Use pipe instead of $stdin.read.
------------------------------------------------------------------------

	* test/ruby/envutil.rb (invoke_ruby): remove :timeout option before
	  pass it to Kernel#spawn.

	* 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]

	* test/ruby/envutil.rb (EnvUtil.invoke_ruby): yield also child pid
	  in block form.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@34426 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
naruse 2012-02-03 07:17:03 +00:00
parent 5dc6d20cc3
commit e892c81cb1
5 changed files with 51 additions and 13 deletions

View file

@ -1058,7 +1058,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 */
@ -3851,7 +3851,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