guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[shepherd] 02/07: Switch from SRFI-11 to SRFI-71.


From: Ludovic Courtès
Subject: [shepherd] 02/07: Switch from SRFI-11 to SRFI-71.
Date: Wed, 19 Apr 2023 18:17:32 -0400 (EDT)

civodul pushed a commit to branch master
in repository shepherd.

commit fd42347f411fb570ed4df88538846df5a048fc05
Author: Ludovic Courtès <ludo@gnu.org>
AuthorDate: Wed Apr 19 12:15:53 2023 +0200

    Switch from SRFI-11 to SRFI-71.
    
    * modules/shepherd/scripts/herd.scm (display-status-summary): Switch to
    SRFI-71 'let*' instead of SRFI-11.
    * modules/shepherd/system.scm.in (%libc-reboot, sysconf, prctl)
    (getpgid, pipe2, sigprocmask): Likewise.
---
 modules/shepherd/scripts/herd.scm | 28 ++++++++++++++--------------
 modules/shepherd/system.scm.in    | 17 ++++++++---------
 2 files changed, 22 insertions(+), 23 deletions(-)

diff --git a/modules/shepherd/scripts/herd.scm 
b/modules/shepherd/scripts/herd.scm
index 998b5d7..fe1ed66 100644
--- a/modules/shepherd/scripts/herd.scm
+++ b/modules/shepherd/scripts/herd.scm
@@ -25,7 +25,7 @@
   #:use-module (ice-9 rdelim)
   #:use-module (ice-9 match)
   #:use-module (srfi srfi-1)
-  #:use-module (srfi srfi-11)
+  #:use-module (srfi srfi-71)
   #:use-module (srfi srfi-19)
   #:export (main))
 
@@ -58,19 +58,19 @@ of pairs."
                           (service-canonical-name service)))
                 (sort services service<?))))      ;get deterministic output
 
-  (let*-values (((started stopped)
-                 (partition (match-lambda
-                              (('service ('version 0 _ ...) properties ...)
-                               (car (assoc-ref properties 'running))))
-                            services))
-                ((one-shot stopped)
-                 (partition (match-lambda
-                              (('service ('version 0 _ ...) properties ...)
-                               ;; Prior to 0.6.1, shepherd did not send the
-                               ;; 'one-shot?' property; thus, do not assume
-                               ;; that it's available.
-                               (and=> (assoc-ref properties 'one-shot?) car)))
-                            stopped)))
+  (let* ((started stopped
+                  (partition (match-lambda
+                               (('service ('version 0 _ ...) properties ...)
+                                (car (assoc-ref properties 'running))))
+                             services))
+         (one-shot stopped
+                   (partition (match-lambda
+                                (('service ('version 0 _ ...) properties ...)
+                                 ;; Prior to 0.6.1, shepherd did not send the
+                                 ;; 'one-shot?' property; thus, do not assume
+                                 ;; that it's available.
+                                 (and=> (assoc-ref properties 'one-shot?) 
car)))
+                              stopped)))
     (display-services (l10n "Started:\n") "+"
                       started)
     (display-services (l10n "Stopped:\n") "-"
diff --git a/modules/shepherd/system.scm.in b/modules/shepherd/system.scm.in
index 29357aa..c2015c7 100644
--- a/modules/shepherd/system.scm.in
+++ b/modules/shepherd/system.scm.in
@@ -1,5 +1,5 @@
 ;; system.scm -- Low-level operating system interface.
-;; Copyright (C) 2013-2014, 2016, 2018, 2020, 2022 Ludovic Courtès 
<ludo@gnu.org>
+;; Copyright (C) 2013-2014, 2016, 2018, 2020, 2022-2023 Ludovic Courtès 
<ludo@gnu.org>
 ;; Copyright (C) 2018 Carlo Zancanaro <carlo@zancanaro.id.au>
 ;; Copyright (C) 2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
 ;;
@@ -22,7 +22,7 @@
   #:use-module (system foreign)
   #:use-module (ice-9 binary-ports)
   #:use-module (rnrs bytevectors)
-  #:use-module (srfi srfi-11)
+  #:use-module (srfi srfi-71)
   #:use-module (srfi srfi-26)
   #:export (disable-reboot-on-ctrl-alt-del
             reboot
@@ -75,7 +75,7 @@ the returned procedure is called."
             (else howto)))
 
     (lambda (howto)
-      (let-values (((ret err) (proc howto)))
+      (let ((ret err (proc howto)))
         (unless (zero? ret)
           (throw 'system-error "reboot" "~A: ~S"
                  (list (strerror err) (howto->symbol howto))
@@ -107,7 +107,7 @@ ctrlaltdel(8) and see kernel/reboot.c in Linux."
   (let ((proc (syscall->procedure long "sysconf" (list int))))
     (lambda (name)
       "Return the system configuration for NAME."
-      (let-values (((result err) (proc name)))
+      (let ((result err (proc name)))
         (if (= -1 result)
             (throw 'system-error "sysconf" "~A: ~S"
                    (list (strerror err) name)
@@ -120,7 +120,7 @@ ctrlaltdel(8) and see kernel/reboot.c in Linux."
   (let ((proc (syscall->procedure long "prctl" (list int int))))
     (lambda (process operation)
       "Perform an operation on the given process"
-      (let-values (((result err) (proc process operation)))
+      (let ((result err (proc process operation)))
         (if (= -1 result)
             (throw 'system-error "prctl" "~A"
                    (list (strerror err))
@@ -136,7 +136,7 @@ ctrlaltdel(8) and see kernel/reboot.c in Linux."
   (let ((proc (syscall->procedure int "getpgid" (list int))))
     (lambda (pid)
       "Return the process group ID for process PID."
-      (let-values (((result err) (proc pid)))
+      (let ((result err (proc pid)))
         (if (= -1 result)
             (throw 'system-error "getpgid" "~A"
                    (list (strerror err))
@@ -180,7 +180,7 @@ local machine.  The car is the input port, and the cdr is 
the output port.
 The difference compared to 'pipe' is that is the optional FLAGS argument."
       (let* ((bv  (make-bytevector (* (sizeof int) 2)))
              (ptr (bytevector->pointer bv)))
-        (let-values (((result err) (proc ptr flags)))
+        (let ((result err (proc ptr flags)))
           (if (zero? result)
               (let ((in  (bytevector-sint-ref bv 0
                                               (native-endianness)
@@ -265,8 +265,7 @@ set of blocked signals as a list of SIG* values."
       (define old
         (allocate-sigset))
 
-      (let-values (((result err)
-                    (proc how (sigset signals) old)))
+      (let ((result err (proc how (sigset signals) old)))
         (if (= -1 result)
             (throw 'system-error "sigprocmask" "~A"
                    (list (strerror err)) (list err))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]