[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
12/21: installer: Close unused ports in pipe-cmd.
From: |
John Darrington |
Subject: |
12/21: installer: Close unused ports in pipe-cmd. |
Date: |
Sat, 31 Dec 2016 14:54:18 +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)
- branch wip-installer updated (d654694 -> d5eb580), John Darrington, 2016/12/31
- 03/21: installer: Add inetutils bin directory to PATH., John Darrington, 2016/12/31
- 05/21: installer: Enable scrolling in the installation window., John Darrington, 2016/12/31
- 06/21: installer: Wrap installer in (catch #t ...), John Darrington, 2016/12/31
- 16/21: installer: Prevent the user specifying the same mount point twice., John Darrington, 2016/12/31
- 04/21: installer: Turn off kernel ring messages to console., John Darrington, 2016/12/31
- 01/21: installer: Add wireless-tools bin directory to PATH., John Darrington, 2016/12/31
- 02/21: installer: Replace an instance of cdr with match., John Darrington, 2016/12/31
- 12/21: installer: Close unused ports in pipe-cmd.,
John Darrington <=
- 08/21: installer: Use consistent window heights., John Darrington, 2016/12/31
- 20/21: installer: Do not use /tmp for holding the configuration., John Darrington, 2016/12/31
- 14/21: installer: Issue message to user on failure of filesystems task., John Darrington, 2016/12/31
- 07/21: installer: Rename module "new" to "guixsd-installer"., John Darrington, 2016/12/31
- 13/21: installer: Replace spawned mount command with the mount syscall., John Darrington, 2016/12/31
- 11/21: installer: Improve install page., John Darrington, 2016/12/31
- 10/21: installer: Replace "%temporary-configuration-file-port" with "config-file"., John Darrington, 2016/12/31
- 19/21: installer: Use global variable instead of string literal for "/gnu"., John Darrington, 2016/12/31
- 17/21: installer: Change N_ from a procedure to a macro., John Darrington, 2016/12/31
- 18/21: installer: Change the order of the filesystem task conditions., John Darrington, 2016/12/31