unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#65036] [PATCH] syscalls: Consistently use existing linux? definition
@ 2023-08-03 11:20 soeren
  2023-08-14 22:07 ` bug#65036: " Ludovic Courtès
  0 siblings, 1 reply; 2+ messages in thread
From: soeren @ 2023-08-03 11:20 UTC (permalink / raw)
  To: 65036

From: Sören Tempel <soeren@soeren-tempel.net>

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 <soeren@soeren-tempel.net>
---
 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))
 




^ permalink raw reply related	[flat|nested] 2+ messages in thread

* bug#65036: [PATCH] syscalls: Consistently use existing linux? definition
  2023-08-03 11:20 [bug#65036] [PATCH] syscalls: Consistently use existing linux? definition soeren
@ 2023-08-14 22:07 ` Ludovic Courtès
  0 siblings, 0 replies; 2+ messages in thread
From: Ludovic Courtès @ 2023-08-14 22:07 UTC (permalink / raw)
  To: soeren; +Cc: 65036-done

Hi,

soeren@soeren-tempel.net skribis:

> From: Sören Tempel <soeren@soeren-tempel.net>
>
> 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 <soeren@soeren-tempel.net>

Applied and tweaked the commit log.  Thanks!

Ludo’.




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-08-14 22:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-03 11:20 [bug#65036] [PATCH] syscalls: Consistently use existing linux? definition soeren
2023-08-14 22:07 ` bug#65036: " Ludovic Courtès

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).