summaryrefslogtreecommitdiff
path: root/guix/ftp-client.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2015-11-22 14:35:28 +0100
committerLudovic Courtès <ludo@gnu.org>2015-11-22 14:35:28 +0100
commit862d2479f686abaa4d1881ad6eafb689bec157e8 (patch)
tree0c86f1e42cc5d4c33dbe95890ce42867fc0a7bf3 /guix/ftp-client.scm
parentd6d33984df8df4f061eadaac1d71119c97c0db9f (diff)
downloadguix-patches-862d2479f686abaa4d1881ad6eafb689bec157e8.tar
guix-patches-862d2479f686abaa4d1881ad6eafb689bec157e8.tar.gz
ftp-client: Default port for 'ftp-open' is now "ftp".
* guix/ftp-client.scm (ftp-open): Change default #:port to "ftp". * guix/scripts/lint.scm (probe-uri): Remove 'port' parameter to 'ftp-open'.
Diffstat (limited to 'guix/ftp-client.scm')
-rw-r--r--guix/ftp-client.scm9
1 files changed, 6 insertions, 3 deletions
diff --git a/guix/ftp-client.scm b/guix/ftp-client.scm
index a6a54a4d9c..22d4c7dde2 100644
--- a/guix/ftp-client.scm
+++ b/guix/ftp-client.scm
@@ -121,15 +121,18 @@ seconds to wait for the connection to succeed."
(raise-error errno)))))
(connect s sockaddr)))
-(define* (ftp-open host #:optional (port 21) #:key timeout)
+(define* (ftp-open host #:optional (port "ftp") #:key timeout)
"Open an FTP connection to HOST on PORT (a service-identifying string,
or a TCP port number), and return it.
When TIMEOUT is not #f, it must be a (possibly inexact) number denoting the
maximum duration in seconds to wait for the connection to complete; passed
TIMEOUT, an ETIMEDOUT error is raised."
- ;; Use 21 as the default PORT instead of "ftp", to avoid depending on
- ;; libc's NSS, which is not available during bootstrap.
+ ;; Using "ftp" for PORT instead of 21 allows 'getaddrinfo' to return only
+ ;; TCP/IP addresses (otherwise it would return SOCK_DGRAM and SOCK_RAW
+ ;; addresses as well.) With our bootstrap Guile, which includes a
+ ;; statically-linked NSS, resolving "ftp" works well, as long as
+ ;; /etc/services is available.
(define addresses
(getaddrinfo host