mirror of
git://sourceware.org/git/newlib-cygwin.git
synced 2025-02-08 18:19:08 +08:00
Cygwin: AF_UNIX: improve select_printf output
Don't call get_name, which is useless.
This commit is contained in:
parent
6afbd9bf9a
commit
f4cfd55ee0
@ -1874,13 +1874,13 @@ peek_socket_unix (select_record *me, bool)
|
|||||||
{
|
{
|
||||||
if (me->read_ready)
|
if (me->read_ready)
|
||||||
{
|
{
|
||||||
select_printf ("%s, already ready for read", fh->get_name ());
|
select_printf ("already ready for read");
|
||||||
gotone = 1;
|
gotone = 1;
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
if (fh->get_unread ())
|
if (fh->get_unread ())
|
||||||
{
|
{
|
||||||
select_printf ("read: %s, ready for read", fh->get_name ());
|
select_printf ("ready for read");
|
||||||
gotone += me->read_ready = true;
|
gotone += me->read_ready = true;
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
@ -1901,8 +1901,7 @@ peek_socket_unix (select_record *me, bool)
|
|||||||
fh->grab_admin_pkt (false);
|
fh->grab_admin_pkt (false);
|
||||||
if (fh->saw_shutdown () & _SHUT_RECV)
|
if (fh->saw_shutdown () & _SHUT_RECV)
|
||||||
{
|
{
|
||||||
select_printf ("read: %s, saw shutdown",
|
select_printf ("read: saw shutdown");
|
||||||
fh->get_name ());
|
|
||||||
gotone += me->read_ready = true;
|
gotone += me->read_ready = true;
|
||||||
if (me->except_selected)
|
if (me->except_selected)
|
||||||
gotone += me->except_ready = true;
|
gotone += me->except_ready = true;
|
||||||
@ -1912,22 +1911,20 @@ peek_socket_unix (select_record *me, bool)
|
|||||||
}
|
}
|
||||||
if (packet->data_len)
|
if (packet->data_len)
|
||||||
{
|
{
|
||||||
select_printf ("read: %s, ready for read: avail %d",
|
select_printf ("read: ready for read: avail %d",
|
||||||
fh->get_name (), packet->data_len);
|
packet->data_len);
|
||||||
gotone += me->read_ready = true;
|
gotone += me->read_ready = true;
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
else if (fh->get_socket_type () == SOCK_DGRAM)
|
else if (fh->get_socket_type () == SOCK_DGRAM)
|
||||||
{
|
{
|
||||||
select_printf ("read: %s, ready for read: 0-length datagram packet",
|
select_printf ("read: ready for read: 0-length datagram packet");
|
||||||
fh->get_name ());
|
|
||||||
gotone += me->read_ready = true;
|
gotone += me->read_ready = true;
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
select_printf ("read: %s, 0-length stream socket packet",
|
select_printf ("read: 0-length stream socket packet");
|
||||||
fh->get_name ());
|
|
||||||
gotone += me->read_ready = true;
|
gotone += me->read_ready = true;
|
||||||
if (me->except_selected)
|
if (me->except_selected)
|
||||||
gotone += me->except_ready = true;
|
gotone += me->except_ready = true;
|
||||||
@ -1959,15 +1956,14 @@ peek_socket_unix (select_record *me, bool)
|
|||||||
block. */
|
block. */
|
||||||
if (!NT_SUCCESS (status))
|
if (!NT_SUCCESS (status))
|
||||||
{
|
{
|
||||||
select_printf ("%s, NtQueryInformationFile failed, status %y",
|
select_printf ("NtQueryInformationFile failed, status %y",
|
||||||
fh->get_name (), status);
|
status);
|
||||||
gotone += me->read_ready = true;
|
gotone += me->read_ready = true;
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
if (fpli.NamedPipeState != FILE_PIPE_LISTENING_STATE)
|
if (fpli.NamedPipeState != FILE_PIPE_LISTENING_STATE)
|
||||||
{
|
{
|
||||||
select_printf ("%s, pipe state %d", fh->get_name (),
|
select_printf ("pipe state %d", fpli.NamedPipeState);
|
||||||
fpli.NamedPipeState);
|
|
||||||
gotone += me->read_ready = true;
|
gotone += me->read_ready = true;
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
@ -1978,7 +1974,7 @@ out:
|
|||||||
{
|
{
|
||||||
if (me->write_ready)
|
if (me->write_ready)
|
||||||
{
|
{
|
||||||
select_printf ("%s, already ready for write", fh->get_name ());
|
select_printf ("already ready for write");
|
||||||
gotone += 1;
|
gotone += 1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -1997,19 +1993,16 @@ out:
|
|||||||
FilePipeLocalInformation);
|
FilePipeLocalInformation);
|
||||||
if (!NT_SUCCESS (status))
|
if (!NT_SUCCESS (status))
|
||||||
{
|
{
|
||||||
select_printf ("%s, NtQueryInformationFile failed, status %y",
|
select_printf ("NtQueryInformationFile failed, status %y",
|
||||||
fh->get_name (), status);
|
status);
|
||||||
/* See the comment in pipe_data_available. */
|
/* See the comment in pipe_data_available. */
|
||||||
gotone += me->write_ready = true;
|
gotone += me->write_ready = true;
|
||||||
}
|
}
|
||||||
else if (fpli.WriteQuotaAvailable >= MAX_AF_PKT_LEN)
|
else if (fpli.WriteQuotaAvailable >= MAX_AF_PKT_LEN)
|
||||||
{
|
{
|
||||||
select_printf ("%s, read for write", fh->get_name ());
|
select_printf ("read for write");
|
||||||
gotone += me->write_ready = true;
|
gotone += me->write_ready = true;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
select_printf ("%s, WriteQuotaAvailable %PRIu32", fh->get_name (),
|
|
||||||
fpli.WriteQuotaAvailable);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return gotone;
|
return gotone;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user