Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/winsup
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2004-12-17 20:42:03 +0300
committerChristopher Faylor <me@cgf.cx>2004-12-17 20:42:03 +0300
commit8232f2e050785e61113a926aa922e4004dd9c118 (patch)
tree85eeaddd13b4bbae2f497b44dad503b59e935a0e /winsup
parent0d549859a5ec98f238073b28065c9f7fc854d445 (diff)
* sigproc.cc (proc_subproc): Fix long-standing problem. Only wait for "all
processes" if pid == -1 -- not just if pid is negative. (proc_can_be_signalled): Fix another long-standing problem. Set correct errno when detecting an exited process.
Diffstat (limited to 'winsup')
-rw-r--r--winsup/cygwin/ChangeLog7
-rw-r--r--winsup/cygwin/sigproc.cc21
2 files changed, 16 insertions, 12 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index 3d1dba084..8743c0ac1 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,3 +1,10 @@
+2004-12-17 Christopher Faylor <cgf@timesys.com>
+
+ * sigproc.cc (proc_subproc): Fix long-standing problem. Only wait for
+ "all processes" if pid == -1 -- not just if pid is negative.
+ (proc_can_be_signalled): Fix another long-standing problem. Set
+ correct errno when detecting an exited process.
+
2004-12-16 Thomas Wolff <towo@computer.org>
* fhandler_console.cc (get_win32_attr): Avoid inappropriate intensity
diff --git a/winsup/cygwin/sigproc.cc b/winsup/cygwin/sigproc.cc
index 7b3ba89ad..7f296d288 100644
--- a/winsup/cygwin/sigproc.cc
+++ b/winsup/cygwin/sigproc.cc
@@ -169,19 +169,16 @@ get_proc_lock (DWORD what, DWORD val)
static bool __stdcall
proc_can_be_signalled (_pinfo *p)
{
- if (p->sendsig == INVALID_HANDLE_VALUE)
+ if (p->sendsig != INVALID_HANDLE_VALUE)
{
- set_errno (EPERM);
- return false;
- }
-
- if (p == myself_nowait || p == myself)
- return hwait_sig;
+ if (p == myself_nowait || p == myself)
+ return hwait_sig;
- if (ISSTATE (p, PID_INITIALIZING) ||
- (((p)->process_state & (PID_ACTIVE | PID_IN_USE)) ==
- (PID_ACTIVE | PID_IN_USE)))
- return true;
+ if (ISSTATE (p, PID_INITIALIZING) ||
+ (((p)->process_state & (PID_ACTIVE | PID_IN_USE)) ==
+ (PID_ACTIVE | PID_IN_USE)))
+ return true;
+ }
set_errno (ESRCH);
return false;
@@ -278,7 +275,7 @@ proc_subproc (DWORD what, DWORD val)
case PROC_WAIT:
wval->ev = NULL; // Don't know event flag yet
- if (wval->pid <= 0)
+ if (wval->pid == -1)
child = NULL; // Not looking for a specific pid
else if (!mychild (wval->pid))
goto out; // invalid pid. flag no such child