aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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