4
0
mirror of git://sourceware.org/git/newlib-cygwin.git synced 2025-02-08 18:19:08 +08:00

Cygwin: AF_UNIX: grab_admin_pkt: check for unread data in pipe

If there's unread data in the pipe from a previous partial read of a
packet, just return.  There can't be an administrative packet waiting
to be read in that case.
This commit is contained in:
Ken Brown 2020-10-26 14:23:10 -04:00
parent 3a6137eb3a
commit abb6475a3b

View File

@ -739,6 +739,9 @@ fhandler_socket_unix::grab_admin_pkt (bool peek)
void *buffer = alloca (MAX_PATH);
af_unix_pkt_hdr_t *packet;
if (get_unread ())
/* There's data in the pipe from a previous partial read of a packet. */
return 0;
if (!(evt = create_event ()))
return 0;
if (peek)