summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-05-15 00:33:57 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-05-15 00:33:57 +0000
commit277d89447adf85d01f624675db3174189fa0a68a (patch)
treeee5960911ef9b40b75bcf16303e740247dff6eae
parentf5a6a36471123985aa452b6c03d1667c4e447d29 (diff)
* win32/win32.c (kill): fix typo and add signal 0 support.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3796 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog12
-rw-r--r--win32/win32.c24
2 files changed, 30 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index 44e4a6f27c..1f573551db 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,11 +1,15 @@
+Thu May 15 09:32:25 2003 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * win32/win32.c (kill): fix typo and add signal 0 support.
+
Wed May 14 20:09:26 2003 why the lucky stiff <ruby-cvs@whytheluckystiff.net>
- * ext/syck/gram.c: sequence-in-map shortcut, transfer methods on
- sequence-in-sequence, memory leak in mapping merge.
+ * ext/syck/gram.c: sequence-in-map shortcut, transfer methods on
+ sequence-in-sequence, memory leak in mapping merge.
- * ext/syck/syck.c: memory leak in domain anchoring.
+ * ext/syck/syck.c: memory leak in domain anchoring.
- * lib/yaml/rubytypes.rb, lib/yaml/types.rb: eliminated 1.6.x code.
+ * lib/yaml/rubytypes.rb, lib/yaml/types.rb: eliminated 1.6.x code.
Wed May 14 19:56:43 2003 NAKAMURA Usaku <usa@ruby-lang.org>
diff --git a/win32/win32.c b/win32/win32.c
index c0aff25619..da785c78b8 100644
--- a/win32/win32.c
+++ b/win32/win32.c
@@ -2540,10 +2540,30 @@ kill(int pid, int sig)
}
if (IsWin95()) pid = -pid;
- if ((unsigned int)pid == GetCurrentProcessId() && sig != SIGKILL)
+ if ((unsigned int)pid == GetCurrentProcessId() &&
+ (sig != 0 && sig != SIGKILL))
return raise(sig);
switch (sig) {
+ case 0:
+ RUBY_CRITICAL({
+ HANDLE hProc =
+ OpenProcess(PROCESS_QUERY_INFORMATION, FALSE, (DWORD)pid);
+ if (hProc == NULL || hProc == INVALID_HANDLE_VALUE) {
+ if (GetLastError() == ERROR_INVALID_PARAMETER) {
+ errno = ESRCH;
+ }
+ else {
+ errno = EPERM;
+ }
+ ret = -1;
+ }
+ else {
+ CloseHandle(hProc);
+ }
+ });
+ break;
+
case SIGINT:
RUBY_CRITICAL({
if (!GenerateConsoleCtrlEvent(CTRL_C_EVENT, (DWORD)pid)) {
@@ -2576,7 +2596,7 @@ kill(int pid, int sig)
});
break;
- define:
+ default:
errno = EINVAL;
ret = -1;
break;