guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[shepherd] 03/04: comm: Expose 'make-shepherd-output-port' in lieu of 's


From: Ludovic Courtès
Subject: [shepherd] 03/04: comm: Expose 'make-shepherd-output-port' in lieu of 'shepherd-output-port'.
Date: Mon, 5 Mar 2018 11:46:24 -0500 (EST)

civodul pushed a commit to branch master
in repository shepherd.

commit 3e38d7997b6411d8224005a73e6adf778c4e734a
Author: Danny Milosavljevic <address@hidden>
Date:   Mon Mar 5 16:41:19 2018 +0100

    comm: Expose 'make-shepherd-output-port' in lieu of 'shepherd-output-port'.
    
    * modules/shepherd/comm.scm (make-shepherd-output-port): Make
    'original-output-port' optional, and make public.
    (shepherd-output-port): Remove.
    * modules/shepherd.scm (main): Adjust accordingly.
    
    Co-authored-by: Ludovic Courtès <address@hidden>
---
 modules/shepherd.scm      | 2 +-
 modules/shepherd/comm.scm | 8 ++++----
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/modules/shepherd.scm b/modules/shepherd.scm
index 2b4a7b5..0f21084 100644
--- a/modules/shepherd.scm
+++ b/modules/shepherd.scm
@@ -164,7 +164,7 @@
     (start-logging logfile)
 
     ;; Send output to log and clients.
-    (set-current-output-port shepherd-output-port)
+    (set-current-output-port (make-shepherd-output-port))
 
     ;; Start the 'root' service.
     (start root-service)
diff --git a/modules/shepherd/comm.scm b/modules/shepherd/comm.scm
index dc6e904..aeb138e 100644
--- a/modules/shepherd/comm.scm
+++ b/modules/shepherd/comm.scm
@@ -1,6 +1,7 @@
 ;; comm.scm -- Communication between processes and general output.
 ;; Copyright (C) 2013, 2014, 2016, 2018 Ludovic Courtès <address@hidden>
 ;; Copyright (C) 2002, 2003 Wolfgang Jährling <address@hidden>
+;; Copyright (C) 2018 Danny Milosavljevic <address@hidden>
 ;;
 ;; This file is part of the GNU Shepherd.
 ;;
@@ -50,7 +51,7 @@
 
             start-logging
             stop-logging
-            shepherd-output-port
+            make-shepherd-output-port
 
             %current-client-socket
             %current-logfile-date-format))
@@ -215,7 +216,8 @@ on service '~a':")
 ;; We provide our own output mechanism, because we have certain
 ;; special needs; most importantly, we want to send output to herd
 ;; sometimes.
-(define (make-shepherd-output-port original-output-port)
+(define* (make-shepherd-output-port
+          #:optional (original-output-port (current-output-port)))
   (make-soft-port
    (vector
 
@@ -272,5 +274,3 @@ on service '~a':")
    ;; It's an output-only port.
    "w"))
 
-(define shepherd-output-port
-  (make-shepherd-output-port (current-output-port)))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]