all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Ludovic Courtès" <ludo@gnu.org>
To: 27426@debbugs.gnu.org
Cc: "Ludovic Courtès" <ludovic.courtes@inria.fr>
Subject: [bug#27426] [PATCH 1/2] store: Define a default port for TCP connections.
Date: Mon, 19 Jun 2017 18:04:51 +0200	[thread overview]
Message-ID: <20170619160452.31679-1-ludo@gnu.org> (raw)
In-Reply-To: <20170619160302.31557-1-ludo@gnu.org>

From: Ludovic Courtès <ludovic.courtes@inria.fr>

* guix/store.scm (%default-guix-port): New variable.
(connect-to-daemon)[connect]: Use it when (uri-port uri) is #f.
---
 guix/store.scm | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/guix/store.scm b/guix/store.scm
index 2acab6b1a..d8fa833ea 100644
--- a/guix/store.scm
+++ b/guix/store.scm
@@ -379,6 +379,10 @@
       (connect s a)
       s)))
 
+(define %default-guix-port
+  ;; Default port when connecting to a daemon over TCP/IP.
+  44146)
+
 (define (open-inet-socket host port)
   "Connect to the Unix-domain socket at HOST:PORT and return it.  Raise a
 '&nix-connection-error' upon error."
@@ -440,12 +444,8 @@ name."
             (open-unix-domain-socket (uri-path uri))))
          ('guix
           (lambda (_)
-            (unless (uri-port uri)
-              (raise (condition (&nix-connection-error
-                                 (file (uri->string uri))
-                                 (errno EBADR))))) ;bah!
-
-            (open-inet-socket (uri-host uri) (uri-port uri))))
+            (open-inet-socket (uri-host uri)
+                              (or (uri-port uri) %default-guix-port))))
          ((? symbol? scheme)
           ;; Try to dynamically load a module for SCHEME.
           ;; XXX: Errors are swallowed.
-- 
2.13.1

  reply	other threads:[~2017-06-19 16:06 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-19 16:03 [bug#27426] [PATCH 0/2] 'guix-daemon --listen' can specify multiple interfaces Ludovic Courtès
2017-06-19 16:04 ` Ludovic Courtès [this message]
2017-06-19 16:04   ` [bug#27426] [PATCH 2/2] daemon: '--listen' can be passed several times, can specify TCP endpoints Ludovic Courtès
2017-06-20 12:29 ` [bug#27426] [PATCH 0/2] 'guix-daemon --listen' can specify multiple interfaces Roel Janssen
2017-06-20 13:28   ` Roel Janssen
2017-06-20 14:08     ` Ludovic Courtès
2017-06-20 15:15       ` Roel Janssen
2017-06-22  9:02         ` bug#27426: " Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170619160452.31679-1-ludo@gnu.org \
    --to=ludo@gnu.org \
    --cc=27426@debbugs.gnu.org \
    --cc=ludovic.courtes@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.