[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
55/80: installer: Close unused ports in pipe-cmd.
From: |
John Darrington |
Subject: |
55/80: installer: Close unused ports in pipe-cmd. |
Date: |
Tue, 3 Jan 2017 15:49:44 +0000 (UTC) |
jmd pushed a commit to branch wip-installer
in repository guix.
commit 91eaa52b2ba27ee2abf17bf2c136fdf9a2f5d511
Author: John Darrington <address@hidden>
Date: Thu Dec 29 19:18:52 2016 +0100
installer: Close unused ports in pipe-cmd.
* gnu/system/installer/utils.scm (pipe-cmd): Close all unused ports.
---
gnu/system/installer/utils.scm | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
diff --git a/gnu/system/installer/utils.scm b/gnu/system/installer/utils.scm
index 8623169..04f53ab 100644
--- a/gnu/system/installer/utils.scm
+++ b/gnu/system/installer/utils.scm
@@ -77,23 +77,22 @@
(define* (pipe-cmd ipipe cmd #:rest args)
"Run CMD ARGS ... sending stdout and stderr to IPIPE. Returns the exit
status of CMD."
- (let* (
- (pipep (pipe))
+ (let* ((pipep (pipe))
(pid (primitive-fork)))
-
(if (zero? pid)
(begin
+ (close-port (car pipep))
(redirect-port (cdr pipep) (current-output-port))
(redirect-port (cdr pipep) (current-error-port))
(apply execlp cmd args))
(begin
- (close (cdr pipep))
+ (close-port (cdr pipep))
(let loop ((c (read-char (car pipep))))
(unless (eof-object? c)
(display c ipipe)
(force-output ipipe)
- (loop (read-char (car pipep)))))))
-
+ (loop (read-char (car pipep)))))
+ (close-port (car pipep))))
(cdr (waitpid pid))))
(define (justify text width)
- 61/80: installer: Change the order of the filesystem task conditions., (continued)
- 61/80: installer: Change the order of the filesystem task conditions., John Darrington, 2017/01/03
- 43/80: gnu: Add guix to the path environment for the guix-installer service., John Darrington, 2017/01/03
- 45/80: installer: Replace an instance of cdr with match., John Darrington, 2017/01/03
- 32/80: installer: Add a task to actually call guix system init., John Darrington, 2017/01/03
- 38/80: installer: Replace some instances of "car"., John Darrington, 2017/01/03
- 26/80: installer: Add a new menu to configure wireless interfaces., John Darrington, 2017/01/03
- 59/80: installer: Prevent the user specifying the same mount point twice., John Darrington, 2017/01/03
- 57/80: installer: Issue message to user on failure of filesystems task., John Darrington, 2017/01/03
- 64/80: installer: Add a console-keymap service., John Darrington, 2017/01/03
- 71/80: installer: Make setting up of the network a prerequisite., John Darrington, 2017/01/03
- 55/80: installer: Close unused ports in pipe-cmd.,
John Darrington <=
- 72/80: installer: Ensure that all mount points are absolute paths., John Darrington, 2017/01/03
- 70/80: installer: Change essid --> wireless., John Darrington, 2017/01/03
- 52/80: installer: Fix bug where window-pipe did not return the proper exit status., John Darrington, 2017/01/03
- 78/80: installer: Rename "file-browser" -> "time-zone"., John Darrington, 2017/01/03
- 75/80: installer: Add predicate for the network task., John Darrington, 2017/01/03
- 50/80: installer: Rename module "new" to "guixsd-installer"., John Darrington, 2017/01/03
- 54/80: installer: Improve install page., John Darrington, 2017/01/03
- 62/80: installer: Use global variable instead of string literal for "/gnu"., John Darrington, 2017/01/03
- 63/80: installer: Do not use /tmp for holding the configuration., John Darrington, 2017/01/03
- 56/80: installer: Replace spawned mount command with the mount syscall., John Darrington, 2017/01/03