* fhandler.cc (fhandler_base::wait_overlapped): Honor nonblocking flag for
writes. Don't reset event handle when we see a ERROR_IO_PENDING. * sigproc.cc (stopped_or_terminated): Use bool constants for consistency. * wait.cc (wait4): Remove nonsensical comment.
This commit is contained in:
parent
792c564b27
commit
6a712635dd
@ -1,3 +1,13 @@
|
|||||||
|
2009-06-14 Christopher Faylor <me+cygwin@cgf.cx>
|
||||||
|
|
||||||
|
* fhandler.cc (fhandler_base::wait_overlapped): Honor nonblocking flag
|
||||||
|
for writes. Don't reset event handle when we see a ERROR_IO_PENDING.
|
||||||
|
|
||||||
|
* sigproc.cc (stopped_or_terminated): Use bool constants for
|
||||||
|
consistency.
|
||||||
|
|
||||||
|
* wait.cc (wait4): Remove nonsensical comment.
|
||||||
|
|
||||||
2009-06-13 Corinna Vinschen <corinna@vinschen.de>
|
2009-06-13 Corinna Vinschen <corinna@vinschen.de>
|
||||||
|
|
||||||
* fhandler_socket.cc (fhandler_socket::recv_internal): Set namelen
|
* fhandler_socket.cc (fhandler_socket::recv_internal): Set namelen
|
||||||
|
@ -1684,7 +1684,12 @@ fhandler_base::wait_overlapped (bool inres, bool writing, DWORD *bytes)
|
|||||||
int res = 0;
|
int res = 0;
|
||||||
|
|
||||||
DWORD err;
|
DWORD err;
|
||||||
if (inres || ((err = GetLastError ()) == ERROR_IO_PENDING))
|
if (is_nonblocking ())
|
||||||
|
{
|
||||||
|
err = GetLastError ();
|
||||||
|
res = inres;
|
||||||
|
}
|
||||||
|
else if (inres || ((err = GetLastError ()) == ERROR_IO_PENDING))
|
||||||
{
|
{
|
||||||
#ifdef DEBUGGING
|
#ifdef DEBUGGING
|
||||||
if (!get_overlapped ())
|
if (!get_overlapped ())
|
||||||
@ -1745,6 +1750,7 @@ fhandler_base::wait_overlapped (bool inres, bool writing, DWORD *bytes)
|
|||||||
app. Sigh.). Must do this after WFMO and GetOverlappedResult or suffer
|
app. Sigh.). Must do this after WFMO and GetOverlappedResult or suffer
|
||||||
occasional sporadic problems:
|
occasional sporadic problems:
|
||||||
http://cygwin.com/ml/cygwin/2008-08/msg00511.html */
|
http://cygwin.com/ml/cygwin/2008-08/msg00511.html */
|
||||||
|
if (err != ERROR_IO_PENDING)
|
||||||
ResetEvent (get_overlapped ()->hEvent);
|
ResetEvent (get_overlapped ()->hEvent);
|
||||||
if (writing && (err == ERROR_NO_DATA || err == ERROR_BROKEN_PIPE))
|
if (writing && (err == ERROR_NO_DATA || err == ERROR_BROKEN_PIPE))
|
||||||
raise (SIGPIPE);
|
raise (SIGPIPE);
|
||||||
|
@ -1045,13 +1045,13 @@ stopped_or_terminated (waitq *parent_w, _pinfo *child)
|
|||||||
might_match = (w->pid == child->pid);
|
might_match = (w->pid == child->pid);
|
||||||
|
|
||||||
if (!might_match)
|
if (!might_match)
|
||||||
return 0;
|
return false;
|
||||||
|
|
||||||
int terminated;
|
int terminated;
|
||||||
|
|
||||||
if (!((terminated = (child->process_state == PID_EXITED)) ||
|
if (!((terminated = (child->process_state == PID_EXITED)) ||
|
||||||
((w->options & WUNTRACED) && child->stopsig)))
|
((w->options & WUNTRACED) && child->stopsig)))
|
||||||
return 0;
|
return false;
|
||||||
|
|
||||||
parent_w->next = w->next; /* successful wait. remove from wait queue */
|
parent_w->next = w->next; /* successful wait. remove from wait queue */
|
||||||
w->pid = child->pid;
|
w->pid = child->pid;
|
||||||
|
@ -100,8 +100,6 @@ wait4 (int intpid, int *status, int options, struct rusage *r)
|
|||||||
}
|
}
|
||||||
else if (res != WAIT_OBJECT_0)
|
else if (res != WAIT_OBJECT_0)
|
||||||
{
|
{
|
||||||
/* We shouldn't set errno to any random value if we can help it.
|
|
||||||
See the Posix manual for a list of valid values for `errno'. */
|
|
||||||
set_errno (EINVAL);
|
set_errno (EINVAL);
|
||||||
res = -1;
|
res = -1;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user