[hurd,commited] hurd: Fix shutdown() errno on non-sock

Samuel Thibault samuel.thibault@ens-lyon.org
Mon Jan 6 17:04:18 GMT 2025


---
 sysdeps/mach/hurd/shutdown.c | 5 +++++
 1 file changed, 5 insertions(+)

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;
 }
-- 
2.45.2



More information about the Libc-alpha mailing list