* dtable.cc (dtable::init_std_file_from_handle): Mention that console
handles are kernel objects since Windows 8. * fhandler.h (enum conn_state): Add "listener" state. (class fhandler_socket): Drop listener status flag. (fhandler_socket::lseek): Return -1 and errno ESPIPE. (fhandler_serial::lseek): Ditto. * fhandler_socket.cc (fhandler_socket::listen): Set connect_state to listener. Add comment. (fhandler_socket::accept4): Explicitely check if the socket is listening and fail with EINVAL, if not. Explain why we have to do that. (fhandler_socket::recv_internal): Explicitely check if the socket is connected if it's a stream socket. Explain why we have to do that. (fhandler_socket::getpeereid): Drop now redundant test.
This commit is contained in:
@ -371,9 +371,10 @@ dtable::init_std_file_from_handle (int fd, HANDLE handle)
|
||||
FILE_ACCESS_INFORMATION fai;
|
||||
int openflags = O_BINARY;
|
||||
|
||||
/* Console windows are not kernel objects, so the access mask returned
|
||||
by NtQueryInformationFile is meaningless. CMD always hands down
|
||||
stdin handles as R/O handles, but our tty slave sides are R/W. */
|
||||
/* Console windows are no kernel objects up to Windows 7/2008R2, so the
|
||||
access mask returned by NtQueryInformationFile is meaningless. CMD
|
||||
always hands down stdin handles as R/O handles, but our tty slave
|
||||
sides are R/W. */
|
||||
if (fh->is_tty ())
|
||||
{
|
||||
openflags |= O_RDWR;
|
||||
|
Reference in New Issue
Block a user