guix_mirror_bot pushed a commit to branch master
in repository guix.
commit 4ed3c827c61260ed16f69c569117c60f6afd33a3
Author: Ludovic Courtès <[email protected]>
AuthorDate: Fri Sep 12 17:45:08 2025 +0200
services: secret-service: Add #:timeout to ‘secret-service-receive-secrets’.
* gnu/build/secret-service.scm (secret-service-receive-secrets):
Add #:timeout parameter and honor it.
Change-Id: I4b6720444a28e1424ede07b6c329cd355b27b5e3
---
gnu/build/secret-service.scm | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/gnu/build/secret-service.scm b/gnu/build/secret-service.scm
index 0623e482fb..5447563cd9 100644
--- a/gnu/build/secret-service.scm
+++ b/gnu/build/secret-service.scm
@@ -156,10 +156,12 @@ HANDSHAKE-TIMEOUT seconds for handshake to complete.
Return #f on failure."
(unless (= ENOENT (system-error-errno args))
(apply throw args)))))
-(define (secret-service-receive-secrets address)
+(define* (secret-service-receive-secrets address
+ #:key (timeout 60))
"Listen to ADDRESS, an address returned by 'make-socket-address', and wait
for a secret service client to send secrets. Write them to the file system.
-Return the list of files installed on success, and #f otherwise."
+Return the list of files installed on success, and #f if TIMEOUT seconds
+passed without receiving any files or if some other failure occurred."
(define (wait-for-client address)
;; Wait for a connection on ADDRESS. Note: virtio-serial ports are safer
@@ -172,7 +174,7 @@ Return the list of files installed on success, and #f
otherwise."
(log "waiting for secrets on ~a...~%"
(socket-address->string address))
- (if (wait-for-readable-fd sock 60)
+ (if (wait-for-readable-fd sock timeout)
(match (accept sock (logior SOCK_CLOEXEC SOCK_NONBLOCK))
((client . address)
(log "client connection from ~a~%"