From patchwork Thu Aug 3 11:20:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?S=C3=B6ren_Tempel?= X-Patchwork-Id: 52479 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 0A12E27BBE9; Thu, 3 Aug 2023 16:12:03 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 8512127BBE2 for ; Thu, 3 Aug 2023 16:11:59 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qRZyE-0003Qs-Fz; Thu, 03 Aug 2023 11:10:34 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qRWP9-0000wm-6b for guix-patches@gnu.org; Thu, 03 Aug 2023 07:22:07 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qRWP4-0006Jc-GU for guix-patches@gnu.org; Thu, 03 Aug 2023 07:22:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qRWP4-0007Mf-0k for guix-patches@gnu.org; Thu, 03 Aug 2023 07:22:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#65036] [PATCH] syscalls: Consistently use existing linux? definition Resent-From: soeren@soeren-tempel.net Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 03 Aug 2023 11:22:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 65036 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 65036@debbugs.gnu.org X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.169106170928283 (code B ref -1); Thu, 03 Aug 2023 11:22:01 +0000 Received: (at submit) by debbugs.gnu.org; 3 Aug 2023 11:21:49 +0000 Received: from localhost ([127.0.0.1]:50956 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qRWOr-0007M7-2f for submit@debbugs.gnu.org; Thu, 03 Aug 2023 07:21:49 -0400 Received: from lists.gnu.org ([2001:470:142::17]:37898) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qRWOo-0007Lq-6T for submit@debbugs.gnu.org; Thu, 03 Aug 2023 07:21:47 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qRWOi-0000vL-6U for guix-patches@gnu.org; Thu, 03 Aug 2023 07:21:40 -0400 Received: from magnesium.8pit.net ([45.76.88.171]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qRWOe-0006GF-2I; Thu, 03 Aug 2023 07:21:39 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; s=opensmtpd; bh=piq3HuAmYz 0ZSublWNYw+q7hZm+yVf96UF/kswA9A+k=; h=date:subject:to:from; d=soeren-tempel.net; b=l9btCTpLxNOgBzx2WY4svglm/BKv0oXPirfmogQhs1Wpvmu 5fM4UtjB1wtcf35Hvy+sAArjDRKQ6WpUSl3L4mja3UkNAgkEHj8exxlXGjjArzfbZk9cEy 7c9pa9TBpvWESLyB6jAyYr03UxvfF2B1o+HqKVagSEcGt6Kz90r3Eg= Received: from localhost ( [2a02:8109:3b40:398a:3ccd:55c4:c2a:92dc]) by magnesium.8pit.net (OpenSMTPD) with ESMTPSA id 9678ec02 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:YES); Thu, 3 Aug 2023 13:21:31 +0200 (CEST) From: soeren@soeren-tempel.net Date: Thu, 3 Aug 2023 13:20:09 +0200 Message-ID: <20230803112123.6866-1-soeren@soeren-tempel.net> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 Received-SPF: pass client-ip=45.76.88.171; envelope-from=soeren@soeren-tempel.net; helo=magnesium.8pit.net X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Mailman-Approved-At: Thu, 03 Aug 2023 11:10:32 -0400 X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches From: Sören Tempel Instead of duplicating this existing logic across the source file. This will make it easier to add additional linux targets (e.g. linux-musl) in the future. * guix/build/syscalls.scm (readdir*): Use linux? constant. * guix/build/syscalls.scm (write-socket-address!): Use linux? constant. * guix/build/syscalls.scm (read-socket-address): Use linux? constant. Signed-off-by: Sören Tempel --- guix/build/syscalls.scm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/guix/build/syscalls.scm b/guix/build/syscalls.scm index d947b010d3..c9c0bf594d 100644 --- a/guix/build/syscalls.scm +++ b/guix/build/syscalls.scm @@ -1244,7 +1244,7 @@ (define (readdir-procedure name-field-offset sizeof-dirent-header (define readdir* ;; Decide at run time which one must be used. - (if (string-contains %host-type "linux-gnu") + (if linux? (readdir-procedure (c-struct-field-offset %struct-dirent-header/linux name) sizeof-dirent-header/linux @@ -1664,7 +1664,7 @@ (define (write-socket-address!/hurd sockaddr bv index) (error "unsupported socket address" sockaddr))))) (define write-socket-address! - (if (string-contains %host-type "linux-gnu") + (if linux? write-socket-address!/linux write-socket-address!/hurd)) @@ -1696,7 +1696,7 @@ (define* (read-socket-address/hurd bv #:optional (index 0)) (vector family))))) (define read-socket-address - (if (string-contains %host-type "linux-gnu") + (if linux? read-socket-address/linux read-socket-address/hurd))