From 8c95b27ce6f2b5f067efa3c0911eb678ee211937 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Thu, 4 Jul 2013 22:49:00 +0200 Subject: [PATCH] store: Deal with unsupported `setsockopt' operation on GNU/Hurd. * guix/store.scm (open-connection): Silently ignore ENOPROTOOPT on `setsockopt' calls, for the sake of GNU/Hurd. Reported by Matthew Lien at . --- guix/store.scm | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/guix/store.scm b/guix/store.scm index 57e1ca06aa..343da91506 100644 --- a/guix/store.scm +++ b/guix/store.scm @@ -266,8 +266,15 @@ operate, should the disk become full. Return a server object." (socket PF_UNIX SOCK_STREAM 0))) (a (make-socket-address PF_UNIX file))) - ;; Enlarge the receive buffer. - (setsockopt s SOL_SOCKET SO_RCVBUF (* 12 1024)) + (catch 'system-error + (lambda () + ;; Enlarge the receive buffer. + (setsockopt s SOL_SOCKET SO_RCVBUF (* 12 1024))) + (lambda args + ;; On the Hurd, the pflocal server's implementation of `socket_setopt' + ;; always returns ENOPROTOOPT. Ignore it. + (unless (= (system-error-errno args) ENOPROTOOPT) + (apply throw args)))) (catch 'system-error (cut connect s a)