mirror of
git://sourceware.org/git/newlib-cygwin.git
synced 2025-02-22 16:49:45 +08:00
* fhandler_tty.cc (fhandler_pty_master::accept_input): Move read_retval
assignment to prevent race condition. Remove read_retval from return statement.
This commit is contained in:
parent
73593ea1dd
commit
4f96ae699c
@ -1,3 +1,9 @@
|
|||||||
|
2002-11-29 Steve Osborn <bub@io.com>
|
||||||
|
|
||||||
|
* fhandler_tty.cc (fhandler_pty_master::accept_input): Move
|
||||||
|
read_retval assignment to prevent race condition. Remove read_retval
|
||||||
|
from return statement.
|
||||||
|
|
||||||
2002-11-29 Christopher Faylor <cgf@redhat.com>
|
2002-11-29 Christopher Faylor <cgf@redhat.com>
|
||||||
|
|
||||||
* pinfo.h (winpids::set): Renamed from init.
|
* pinfo.h (winpids::set): Renamed from init.
|
||||||
|
@ -153,7 +153,6 @@ fhandler_pty_master::accept_input ()
|
|||||||
rc = WaitForSingleObject (input_mutex, INFINITE);
|
rc = WaitForSingleObject (input_mutex, INFINITE);
|
||||||
|
|
||||||
bytes_left = n = eat_readahead (-1);
|
bytes_left = n = eat_readahead (-1);
|
||||||
get_ttyp ()->read_retval = 0;
|
|
||||||
p = rabuf;
|
p = rabuf;
|
||||||
|
|
||||||
if (n != 0)
|
if (n != 0)
|
||||||
@ -165,9 +164,12 @@ fhandler_pty_master::accept_input ()
|
|||||||
if (!rc)
|
if (!rc)
|
||||||
{
|
{
|
||||||
debug_printf ("error writing to pipe %E");
|
debug_printf ("error writing to pipe %E");
|
||||||
|
get_ttyp ()->read_retval = -1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
get_ttyp ()->read_retval += written;
|
else
|
||||||
|
get_ttyp ()->read_retval = 1;
|
||||||
|
|
||||||
p += written;
|
p += written;
|
||||||
bytes_left -= written;
|
bytes_left -= written;
|
||||||
if (bytes_left > 0)
|
if (bytes_left > 0)
|
||||||
@ -181,10 +183,13 @@ fhandler_pty_master::accept_input ()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
termios_printf ("sending EOF to slave");
|
{
|
||||||
|
termios_printf ("sending EOF to slave");
|
||||||
|
get_ttyp ()->read_retval = 0;
|
||||||
|
}
|
||||||
SetEvent (input_available_event);
|
SetEvent (input_available_event);
|
||||||
ReleaseMutex (input_mutex);
|
ReleaseMutex (input_mutex);
|
||||||
return get_ttyp ()->read_retval;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static DWORD WINAPI
|
static DWORD WINAPI
|
||||||
|
Loading…
x
Reference in New Issue
Block a user