diff --git a/dlls/ntdll/file.c b/dlls/ntdll/file.c index 8158a144877..b3f5379314b 100644 --- a/dlls/ntdll/file.c +++ b/dlls/ntdll/file.c @@ -282,7 +282,7 @@ NTSTATUS FILE_GetNtStatus(void) case ENFILE: return STATUS_TOO_MANY_OPENED_FILES; case EINVAL: return STATUS_INVALID_PARAMETER; case ENOTEMPTY: return STATUS_DIRECTORY_NOT_EMPTY; - case EPIPE: return STATUS_PIPE_BROKEN; + case EPIPE: return STATUS_PIPE_DISCONNECTED; case EIO: return STATUS_DEVICE_NOT_READY; #ifdef ENOMEDIUM case ENOMEDIUM: return STATUS_NO_MEDIA_IN_DEVICE; diff --git a/server/mailslot.c b/server/mailslot.c index d130f6e6364..b29c84e5822 100644 --- a/server/mailslot.c +++ b/server/mailslot.c @@ -197,6 +197,7 @@ static void mailslot_destroy( struct object *obj) assert( mailslot->fd ); assert( mailslot->write_fd ); + shutdown( get_unix_fd( mailslot->fd ), SHUT_RDWR ); release_object( mailslot->fd ); release_object( mailslot->write_fd ); } @@ -408,6 +409,7 @@ static struct mailslot *create_mailslot( struct directory *root, { fcntl( fds[0], F_SETFL, O_NONBLOCK ); fcntl( fds[1], F_SETFL, O_NONBLOCK ); + shutdown( fds[0], SHUT_RD ); mailslot->fd = create_anonymous_fd( &mailslot_fd_ops, fds[1], &mailslot->obj ); mailslot->write_fd = create_anonymous_fd( &mail_writer_fd_ops, diff --git a/server/named_pipe.c b/server/named_pipe.c index 4b238166cd9..527e4c8293c 100644 --- a/server/named_pipe.c +++ b/server/named_pipe.c @@ -338,6 +338,7 @@ static void do_disconnect( struct pipe_server *server ) server->client->fd = NULL; } assert( server->fd ); + shutdown( get_unix_fd( server->fd ), SHUT_RDWR ); release_object( server->fd ); server->fd = NULL; }