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.
This commit is contained in:
Ludovic Courtès 2015-05-21 23:24:49 +02:00
parent ea98270443
commit 60a56db007
2 changed files with 3 additions and 3 deletions

View File

@ -851,10 +851,10 @@ gexp, to open it, and evaluate @var{close} to close it."
(requirement `(udev ,@requirement)) (requirement `(udev ,@requirement))
(documentation "Enable the given swap device.") (documentation "Enable the given swap device.")
(start #~(lambda () (start #~(lambda ()
(swapon #$device) (restart-on-EINTR (swapon #$device))
#t)) #t))
(stop #~(lambda _ (stop #~(lambda _
(swapoff #$device) (restart-on-EINTR (swapoff #$device))
#f)) #f))
(respawn? #f))))) (respawn? #f)))))

View File

@ -218,7 +218,7 @@ constants from <sys/mount.h>."
(let ((ret (proc (string->pointer device))) (let ((ret (proc (string->pointer device)))
(err (errno))) (err (errno)))
(unless (zero? ret) (unless (zero? ret)
(throw 'system-error "swapff" "~S: ~A" (throw 'system-error "swapoff" "~S: ~A"
(list device (strerror err)) (list device (strerror err))
(list err))))))) (list err)))))))