From fdeedfb979281a565c35b4b2b3d1af2e23338b6b Mon Sep 17 00:00:00 2001 From: Ken Brown Date: Wed, 12 May 2021 17:59:34 -0400 Subject: [PATCH] Cygwin: AF_UNIX: add saw_shutdown_read and saw_shutdown_write For consistency between the fhandler_socket_unix and fhandler_socket_wsock classes, add virtual methods saw_shutdown_read and saw_shutdown_write to fhandler_socket. Implement them for fhandler_socket_unix. (They were already implemented for fhandler_socket_wsock.) --- winsup/cygwin/fhandler.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/winsup/cygwin/fhandler.h b/winsup/cygwin/fhandler.h index 7c3cf8103..b98cc6857 100644 --- a/winsup/cygwin/fhandler.h +++ b/winsup/cygwin/fhandler.h @@ -604,6 +604,8 @@ class fhandler_socket: public fhandler_base virtual int getsockopt (int level, int optname, const void *optval, __socklen_t *optlen) = 0; + virtual bool saw_shutdown_read () const = 0; + virtual bool saw_shutdown_write () const = 0; virtual int ioctl (unsigned int cmd, void *); virtual int fcntl (int cmd, intptr_t); @@ -1036,6 +1038,8 @@ class fhandler_socket_unix : public fhandler_socket bind_state binding_state () const { return shmem->binding_state (); } int saw_shutdown (int shut) { return shmem->shutdown (shut); } int saw_shutdown () const { return shmem->shutdown (); } + bool saw_shutdown_read () const { return saw_shutdown () & _SHUT_RECV; } + bool saw_shutdown_write () const { return saw_shutdown () & _SHUT_SEND; } int so_error (int err) { return shmem->so_error (err); } int so_error () const { return shmem->so_error (); } bool so_passcred (bool pc) { return shmem->so_passcred (pc); } -- 2.43.5