summaryrefslogtreecommitdiff
path: root/guix/store.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludovic.courtes@inria.fr>2017-06-19 17:50:28 +0200
committerLudovic Courtès <ludo@gnu.org>2017-06-22 10:59:07 +0200
commit5df1395a8d4bb83e002e1aab5d930edd2b49d27e (patch)
treec04bf1c5f01bc4d454c8820622d27143ad5077eb /guix/store.scm
parent7ae97a4c3f241e6d6e9b8bc6d13ff8d4d9ded9bd (diff)
downloadgnu-guix-5df1395a8d4bb83e002e1aab5d930edd2b49d27e.tar
gnu-guix-5df1395a8d4bb83e002e1aab5d930edd2b49d27e.tar.gz
store: Define a default port for TCP connections.
* guix/store.scm (%default-guix-port): New variable. (connect-to-daemon)[connect]: Use it when (uri-port uri) is #f. * doc/guix.texi (The Store): Mention the default port number.
Diffstat (limited to 'guix/store.scm')
-rw-r--r--guix/store.scm12
1 files changed, 6 insertions, 6 deletions
diff --git a/guix/store.scm b/guix/store.scm
index 9b4c65532e..d1a4c67ae8 100644
--- a/guix/store.scm
+++ b/guix/store.scm
@@ -383,6 +383,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."
@@ -446,12 +450,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.