aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2024-01-17 13:24:11 +0000
committerChristopher Baines <mail@cbaines.net>2024-01-17 13:24:11 +0000
commita9fccb34184c91f5ef29ed0de69185e7191e9a9e (patch)
treef22c1d38c1f89a133301b7f0ae0234c4e184b6fb
parentcbec4a5e392d4fe30a7bfe5e465f66f22ef4d9ee (diff)
downloadbuild-coordinator-a9fccb34184c91f5ef29ed0de69185e7191e9a9e.tar
build-coordinator-a9fccb34184c91f5ef29ed0de69185e7191e9a9e.tar.gz
Force output with the custom port log
-rw-r--r--guix-build-coordinator/coordinator.scm15
1 files changed, 8 insertions, 7 deletions
diff --git a/guix-build-coordinator/coordinator.scm b/guix-build-coordinator/coordinator.scm
index 916ed92..ca579f2 100644
--- a/guix-build-coordinator/coordinator.scm
+++ b/guix-build-coordinator/coordinator.scm
@@ -143,17 +143,18 @@
(port #:init-value #f #:accessor port #:init-keyword #:port))
(define-method (emit-log (self <custom-port-log>) str)
- (if (port self)
- (put-bytevector (port self)
- (string->utf8 str))))
+ (when (port self)
+ (put-bytevector (port self)
+ (string->utf8 str))
+ ;; Even though the port is line buffered, writing to it with
+ ;; put-bytevector doesn't cause the buffer to be flushed.
+ (force-output (port self))))
(define-method (flush-log (self <custom-port-log>))
- (if (port self)
- (force-output (port self))))
+ (and=> (port self) force-output))
(define-method (close-log! (self <custom-port-log>))
- (if (port self)
- (close-port (port self)))
+ (and=> (port self) close-port)
(set! (port self) #f))
(define %known-hooks