summaryrefslogtreecommitdiff
path: root/gnu/services/shepherd.scm
diff options
context:
space:
mode:
authorJohn Kehayias <john.kehayias@protonmail.com>2024-01-07 21:27:27 -0500
committerJohn Kehayias <john.kehayias@protonmail.com>2024-01-07 21:27:27 -0500
commitd9dee5ea2f564fa6979ae552fd9bd5ac22f86ecc (patch)
tree8d1b2f89808f9e7ddbeddeab7563f3ab82e533cd /gnu/services/shepherd.scm
parentef4e4c9a2ccc1678182fa6e4409fff13c669fd14 (diff)
parent3de361d9c9d320aefbd43710124d7b07af891de1 (diff)
Merge branch 'master' into mesa-updates
Change-Id: I0b92a95109688a1a4c50572bc25a4e5676e0921e
Diffstat (limited to 'gnu/services/shepherd.scm')
-rw-r--r--gnu/services/shepherd.scm21
1 files changed, 5 insertions, 16 deletions
diff --git a/gnu/services/shepherd.scm b/gnu/services/shepherd.scm
index e9d3a631c2..8e122f1aab 100644
--- a/gnu/services/shepherd.scm
+++ b/gnu/services/shepherd.scm
@@ -1,5 +1,5 @@
;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2013-2016, 2018-2023 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2013-2016, 2018-2024 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2017 Clément Lassieur <clement@lassieur.org>
;;; Copyright © 2018 Carlo Zancanaro <carlo@zancanaro.id.au>
;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
@@ -371,17 +371,6 @@ as shepherd package."
(use-modules (srfi srfi-34)
(system repl error-handling))
- (define (call-with-file file flags proc)
- (let ((port #f))
- (dynamic-wind
- (lambda ()
- (set! port (open file flags)))
- (lambda ()
- (proc port))
- (lambda ()
- (close-port port)
- (set! port #f)))))
-
;; There's code run from shepherd that uses 'call-with-input-file' &
;; co.--e.g., the 'urandom-seed' service. Starting from Shepherd
;; 0.9.2, users need to make sure not to leak non-close-on-exec file
@@ -389,12 +378,12 @@ as shepherd package."
;; standard bindings with O_CLOEXEC variants.
(set! call-with-input-file
(lambda (file proc)
- (call-with-file file (logior O_RDONLY O_CLOEXEC)
- proc)))
+ (call-with-port (open file (logior O_RDONLY O_CLOEXEC))
+ proc)))
(set! call-with-output-file
(lambda (file proc)
- (call-with-file file (logior O_WRONLY O_CREAT O_CLOEXEC)
- proc)))
+ (call-with-port (open file (logior O_WRONLY O_CREAT O_CLOEXEC))
+ proc)))
;; Specify the default environment visible to all the services.
;; Without this statement, all the environment variables of PID 1