* fhandler.cc (fhandler_base::wait_overlapped): Set bytes to -1 on EINTR or
real error. (fhandler_base::write_overlapped): Assume that bytes_written will contain proper error value. * pipe.cc (fhandler_pipe::fhandler_pipe): Set uninterruptible_io since signals are handled by pipe functions now.
This commit is contained in:
parent
dcad81990b
commit
1ae0cd1335
@ -1,3 +1,12 @@
|
|||||||
|
2009-01-27 Christopher Faylor <me+cygwin@cgf.cx>
|
||||||
|
|
||||||
|
* fhandler.cc (fhandler_base::wait_overlapped): Set bytes to -1 on
|
||||||
|
EINTR or real error.
|
||||||
|
(fhandler_base::write_overlapped): Assume that bytes_written will
|
||||||
|
contain proper error value.
|
||||||
|
* pipe.cc (fhandler_pipe::fhandler_pipe): Set uninterruptible_io since
|
||||||
|
signals are handled by pipe functions now.
|
||||||
|
|
||||||
2009-01-26 Corinna Vinschen <corinna@vinschen.de>
|
2009-01-26 Corinna Vinschen <corinna@vinschen.de>
|
||||||
|
|
||||||
* shared.cc (shared_name): New function for WCHAR names.
|
* shared.cc (shared_name): New function for WCHAR names.
|
||||||
|
@ -1697,7 +1697,7 @@ fhandler_base::wait_overlapped (bool inres, bool writing, DWORD *bytes)
|
|||||||
return inres;
|
return inres;
|
||||||
|
|
||||||
int res = 0;
|
int res = 0;
|
||||||
*bytes = (DWORD) -1;
|
|
||||||
DWORD err;
|
DWORD err;
|
||||||
if (inres || ((err = GetLastError ()) == ERROR_IO_PENDING))
|
if (inres || ((err = GetLastError ()) == ERROR_IO_PENDING))
|
||||||
{
|
{
|
||||||
@ -1722,6 +1722,7 @@ fhandler_base::wait_overlapped (bool inres, bool writing, DWORD *bytes)
|
|||||||
{
|
{
|
||||||
debug_printf ("got a signal");
|
debug_printf ("got a signal");
|
||||||
set_errno (EINTR);
|
set_errno (EINTR);
|
||||||
|
*bytes = (DWORD) -1;
|
||||||
res = 0;
|
res = 0;
|
||||||
err = 0;
|
err = 0;
|
||||||
}
|
}
|
||||||
@ -1732,7 +1733,7 @@ fhandler_base::wait_overlapped (bool inres, bool writing, DWORD *bytes)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
debug_printf ("normal read");
|
debug_printf ("normal %s, %u bytes", writing ? "write" : "read", *bytes);
|
||||||
res = 1;
|
res = 1;
|
||||||
err = 0;
|
err = 0;
|
||||||
}
|
}
|
||||||
@ -1744,6 +1745,7 @@ fhandler_base::wait_overlapped (bool inres, bool writing, DWORD *bytes)
|
|||||||
{
|
{
|
||||||
debug_printf ("err %u", err);
|
debug_printf ("err %u", err);
|
||||||
__seterrno_from_win_error (err);
|
__seterrno_from_win_error (err);
|
||||||
|
*bytes = (DWORD) -1;
|
||||||
res = -1;
|
res = -1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -1787,10 +1789,9 @@ fhandler_base::write_overlapped (const void *ptr, size_t len)
|
|||||||
bool res = WriteFile (get_output_handle (), ptr, len, &bytes_written,
|
bool res = WriteFile (get_output_handle (), ptr, len, &bytes_written,
|
||||||
get_overlapped ());
|
get_overlapped ());
|
||||||
int wres = wait_overlapped (res, true, &bytes_written);
|
int wres = wait_overlapped (res, true, &bytes_written);
|
||||||
if (wres < 0)
|
|
||||||
return -1;
|
|
||||||
if (wres || !_my_tls.call_signal_handler ())
|
if (wres || !_my_tls.call_signal_handler ())
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
debug_printf ("returning %u", bytes_written);
|
||||||
return bytes_written;
|
return bytes_written;
|
||||||
}
|
}
|
||||||
|
@ -26,6 +26,7 @@ fhandler_pipe::fhandler_pipe ()
|
|||||||
: fhandler_base (), popen_pid (0), overlapped (NULL)
|
: fhandler_base (), popen_pid (0), overlapped (NULL)
|
||||||
{
|
{
|
||||||
need_fork_fixup (true);
|
need_fork_fixup (true);
|
||||||
|
uninterruptible_io (true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
Loading…
x
Reference in New Issue
Block a user