summaryrefslogtreecommitdiff
path: root/guix/store.scm
diff options
context:
space:
mode:
authorMark H Weaver <mhw@netris.org>2017-06-26 00:00:58 -0400
committerMark H Weaver <mhw@netris.org>2017-06-26 00:00:58 -0400
commited068b960eeedb92823238783779730319b8ba0e (patch)
tree36a4de280458d52520b911b2716eb5cea309fd78 /guix/store.scm
parenta9308efec642bfbce480545a22fce848e6212456 (diff)
parentffc015bea26f24d862e7e877d907fbe1ab9a9967 (diff)
downloadguix-patches-ed068b960eeedb92823238783779730319b8ba0e.tar
guix-patches-ed068b960eeedb92823238783779730319b8ba0e.tar.gz
Merge branch 'master' into core-updates
Diffstat (limited to 'guix/store.scm')
-rw-r--r--guix/store.scm16
1 files changed, 9 insertions, 7 deletions
diff --git a/guix/store.scm b/guix/store.scm
index b584caa073..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."
@@ -399,7 +403,9 @@
(if (number? port) (number->string port) port)
(if (number? port)
(logior AI_ADDRCONFIG AI_NUMERICSERV)
- AI_ADDRCONFIG)))
+ AI_ADDRCONFIG)
+ 0 ;any address family
+ SOCK_STREAM)) ;TCP only
(let loop ((addresses addresses))
(match addresses
@@ -444,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.