From 60a56db0074259355a590851131aa23e1549fd8c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= <ludo@gnu.org>
Date: Thu, 21 May 2015 23:24:49 +0200
Subject: [PATCH] services: swap: Use 'restart-on-EINTR'.

* gnu/services/base.scm (swap-service)[start, stop]: Use 'restart-on-EINTR'.
* guix/build/syscalls.scm (swapoff): Fix typo in 'throw' arguments.
---
 gnu/services/base.scm   | 4 ++--
 guix/build/syscalls.scm | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/gnu/services/base.scm b/gnu/services/base.scm
index 697b9395c29..d5744204d9d 100644
--- a/gnu/services/base.scm
+++ b/gnu/services/base.scm
@@ -851,10 +851,10 @@ (define requirement
              (requirement `(udev ,@requirement))
              (documentation "Enable the given swap device.")
              (start #~(lambda ()
-                        (swapon #$device)
+                        (restart-on-EINTR (swapon #$device))
                         #t))
              (stop #~(lambda _
-                       (swapoff #$device)
+                       (restart-on-EINTR (swapoff #$device))
                        #f))
              (respawn? #f)))))
 
diff --git a/guix/build/syscalls.scm b/guix/build/syscalls.scm
index 9ec7e8b4a92..3585bf27a87 100644
--- a/guix/build/syscalls.scm
+++ b/guix/build/syscalls.scm
@@ -218,7 +218,7 @@ (define swapoff
       (let ((ret (proc (string->pointer device)))
             (err (errno)))
         (unless (zero? ret)
-          (throw 'system-error "swapff" "~S: ~A"
+          (throw 'system-error "swapoff" "~S: ~A"
                  (list device (strerror err))
                  (list err)))))))
 
-- 
GitLab