[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[no subject]
From: |
Ludovic Courtès |
Date: |
Tue, 9 May 2023 10:28:18 -0400 (EDT) |
branch: master
commit 70917dbfd02f06dcec2272936fdfff7d06f2f048
Author: Ludovic Courtès <ludo@gnu.org>
AuthorDate: Tue May 9 15:25:48 2023 +0200
base: Remove now unnecessary 'read-line/non-blocking' procedure.
It seems 'read-line' has always been non-blocking, according to (ice-9
suspendable-ports) history.
* src/cuirass/base.scm (read-line/non-blocking): Remove.
(process-build-log): Adjust accordingly.
---
src/cuirass/base.scm | 19 +------------------
1 file changed, 1 insertion(+), 18 deletions(-)
diff --git a/src/cuirass/base.scm b/src/cuirass/base.scm
index 668a97d..57dd8a9 100644
--- a/src/cuirass/base.scm
+++ b/src/cuirass/base.scm
@@ -279,23 +279,6 @@ Return a list of jobs that are associated to EVAL-ID."
;;; Build status.
;;;
-;; TODO: Remove this code once it has been integrated in Guix proper as (guix
-;; status).
-
-(define (read-line/non-blocking port)
- "Like 'read-line', but unlike 'read-line', use I/O primitives that can be
-suspended when PORT is O_NONBLOCK in a fiber context."
- (let loop ((chars '()))
- (match (read-char port) ;can suspend
- ((? eof-object? eof)
- (if (null? chars)
- eof
- (list->string (reverse chars))))
- (#\newline
- (list->string (reverse chars)))
- (chr
- (loop (cons chr chars))))))
-
(define (process-build-log port proc seed)
"Read from PORT the build log, calling PROC for each build event like 'fold'
does. Return the result of the last call to PROC."
@@ -306,7 +289,7 @@ does. Return the result of the last call to PROC."
(proc (cons event-name args) state)))))
(let loop ((state seed))
- (match (read-line/non-blocking port)
+ (match (read-line port)
((? eof-object?)
state)
((? string? line)
- [no subject], (continued)
- [no subject], Ludovic Courtès, 2023/05/09
- [no subject], Ludovic Courtès, 2023/05/09
- [no subject], Ludovic Courtès, 2023/05/09
- [no subject], Ludovic Courtès, 2023/05/09
- [no subject], Ludovic Courtès, 2023/05/09
- [no subject], Ludovic Courtès, 2023/05/09
- [no subject], Ludovic Courtès, 2023/05/09
- [no subject], Ludovic Courtès, 2023/05/09
- [no subject], Ludovic Courtès, 2023/05/09
- [no subject], Ludovic Courtès, 2023/05/09
- [no subject],
Ludovic Courtès <=
- [no subject], Ludovic Courtès, 2023/05/09