From: Samuel Thibault Date: Mon, 6 Jan 2025 17:03:10 +0000 (+0100) Subject: hurd: Fix shutdown() errno on non-sock X-Git-Tag: glibc-2.41~128 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6ab5980f4cf973051c0fde8e6bec9ca9b59c3d66;p=thirdparty%2Fglibc.git hurd: Fix shutdown() errno on non-sock --- diff --git a/sysdeps/mach/hurd/shutdown.c b/sysdeps/mach/hurd/shutdown.c index 272d8dcf2f..bf09c0fd29 100644 --- a/sysdeps/mach/hurd/shutdown.c +++ b/sysdeps/mach/hurd/shutdown.c @@ -32,7 +32,12 @@ int shutdown (int fd, int how) { error_t err = HURD_DPORT_USE (fd, __socket_shutdown (port, how)); + + if (err == MIG_BAD_ID || err == EOPNOTSUPP) + /* The file did not grok the ifsock protocol. */ + err = ENOTSOCK; if (err) return __hurd_dfail (fd, err); + return 0; }