aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2022-03-12 15:37:50 -0700
committerSean Whitton <spwhitton@spwhitton.name>2022-03-12 15:39:25 -0700
commite4f4d8ebacc5b44cd110d201de5b26c90cc849be (patch)
tree1065b2b39f7e9a4592569851c0598a01e1d25b33
parent2b89cfb8645afb249f6cc21fe3ae588dae5210be (diff)
downloadconsfigurator-e4f4d8ebacc5b44cd110d201de5b26c90cc849be.tar.gz
MAPC-OPEN-{INPUT,OUTPUT}-STREAMS: don't use &rest
This brings these functions closer to MAPC. Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
-rw-r--r--src/connection/linux-namespace.lisp4
-rw-r--r--src/image.lisp7
-rw-r--r--src/util.lisp8
3 files changed, 10 insertions, 9 deletions
diff --git a/src/connection/linux-namespace.lisp b/src/connection/linux-namespace.lisp
index a6f2e0a..398cf63 100644
--- a/src/connection/linux-namespace.lisp
+++ b/src/connection/linux-namespace.lisp
@@ -316,8 +316,8 @@ setgroups(2) is denied in the namespace."
;; If we entered new PID or time namespaces then need to fork
;; so we're actually within them; for simplicity, always fork.
(mapc-open-output-streams
- #'force-output
- *standard-output* *error-output* *debug-io* *terminal-io*)
+ #'force-output (list *debug-io* *terminal-io*
+ *standard-output* *error-output*))
(let ((child (nix:fork)))
(when (plusp child)
(let ((status (nth-value 1 (nix:waitpid child))))
diff --git a/src/image.lisp b/src/image.lisp
index 76c2fd0..c069569 100644
--- a/src/image.lisp
+++ b/src/image.lisp
@@ -303,7 +303,8 @@ property by applying it like this:
;; standard about closing synonym streams; see
;; <https://bugs.launchpad.net/sbcl/+bug/1904257>.
(loop initially (mapc-open-input-streams
- #'close *standard-input* *debug-io* *terminal-io*)
+ #'close (list *standard-input*
+ *debug-io* *terminal-io*))
with ,fork-control = (open ,fork-control
:element-type 'character)
for (input . output) = (handler-case (with-safe-io-syntax ()
@@ -312,8 +313,8 @@ property by applying it like this:
(close ,fork-control)
(uiop:quit)))
do (mapc-open-output-streams
- #'force-output
- *standard-output* *error-output* *debug-io* *terminal-io*)
+ #'force-output (list *debug-io* *terminal-io*
+ *standard-output* *error-output*))
when (zerop (fork))
do (nix:setsid)
(close ,fork-control)
diff --git a/src/util.lisp b/src/util.lisp
index aefe01c..f5d3498 100644
--- a/src/util.lisp
+++ b/src/util.lisp
@@ -550,8 +550,8 @@ previous output."
`(progn
#-(or sbcl) (error "Don't know how to safely fork(2) in this Lisp.")
(mapc-open-output-streams
- #'force-output
- *standard-output* *error-output* *debug-io* *terminal-io*)
+ #'force-output (list *debug-io* *terminal-io*
+ *standard-output* *error-output*))
(let ((,retval (fork)))
(if (zerop ,retval)
;; We leave it to the caller to appropriately call CLOSE or
@@ -701,7 +701,7 @@ Does not currently establish a PAM session."
(two-way-stream (two-way-stream-input-stream stream))
(stream (and (input-stream-p stream) stream))))
-(defun mapc-open-input-streams (function &rest streams)
+(defun mapc-open-input-streams (function streams)
(dolist (stream streams streams)
(when-let ((input-stream (stream->input-stream stream)))
(when (open-stream-p input-stream)
@@ -714,7 +714,7 @@ Does not currently establish a PAM session."
(two-way-stream (two-way-stream-output-stream stream))
(stream (and (output-stream-p stream) stream))))
-(defun mapc-open-output-streams (function &rest streams)
+(defun mapc-open-output-streams (function streams)
(dolist (stream streams streams)
(when-let ((output-stream (stream->output-stream stream)))
(when (open-stream-p output-stream)