From patchwork Mon Jan 6 17:04:18 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Thibault X-Patchwork-Id: 104193 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 045E43858D35 for ; Mon, 6 Jan 2025 17:05:01 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 045E43858D35 X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from sonata.ens-lyon.org (sonata.ens-lyon.org [140.77.166.138]) by sourceware.org (Postfix) with ESMTPS id 6EB603858C56 for ; Mon, 6 Jan 2025 17:04:20 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 6EB603858C56 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=ens-lyon.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=bounce.ens-lyon.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 6EB603858C56 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=140.77.166.138 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1736183060; cv=none; b=JEzSnK9JKjxk5s1Y33GCgI+FGsjRRuIshUb/UMaAu7O4taxlJFPN2XOddQl5ODtIFrU3p1GXIy88lvktKA7K6KgJVK0MqBwUFLZDQKd9HTeGdRouqK94CrMHV6WUOMHfleBkf4BmzI3XuylQViGVJSYJdWDuZH3v79uz4MNeuxU= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1736183060; c=relaxed/simple; bh=y6DLohuM0ZEIZlUrZw8pSZWH2hnETV1u6u+qsvfFMKs=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=hM1lq148xaKpPLV+QiT0k0vXf7RjQX01S7xQjXt3uVQIJGnycvyqjivy8uIzJUKAXvXV1Tm6GwXLu6XV69ODQDhBQ/eIDXzU/iHehSO0p+lvE7WX9sERoULbXApl5GyzG7oREcL+Wuaw6Z+Ttp6+A5xz2ljVhEQbw8HsdWOUGuY= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6EB603858C56 Received: from localhost (localhost [127.0.0.1]) by sonata.ens-lyon.org (Postfix) with ESMTP id 34825A48C7; Mon, 6 Jan 2025 18:04:19 +0100 (CET) Received: from sonata.ens-lyon.org ([127.0.0.1]) by localhost (sonata.ens-lyon.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 3msUbJP_XPFo; Mon, 6 Jan 2025 18:04:19 +0100 (CET) Received: from begin.home (aaubervilliers-652-1-289-58.w82-121.abo.wanadoo.fr [82.121.86.58]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by sonata.ens-lyon.org (Postfix) with ESMTPSA id B926DA4860; Mon, 6 Jan 2025 18:04:18 +0100 (CET) Received: from samy by begin.home with local (Exim 4.98) (envelope-from ) id 1tUqWY-0000000DuUk-17PA; Mon, 06 Jan 2025 18:04:18 +0100 From: Samuel Thibault To: libc-alpha@sourceware.org Cc: Samuel Thibault , commit-hurd@gnu.org Subject: [hurd,commited] hurd: Fix shutdown() errno on non-sock Date: Mon, 6 Jan 2025 18:04:18 +0100 Message-ID: <20250106170418.3315423-1-samuel.thibault@ens-lyon.org> X-Mailer: git-send-email 2.45.2 MIME-Version: 1.0 X-Spam-Status: No, score=-13.0 required=5.0 tests=BAYES_00, GIT_PATCH_0, JMQ_SPF_NEUTRAL, KAM_DMARC_STATUS, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces~patchwork=sourceware.org@sourceware.org --- 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; }