me
/
guix
Archived
1
0
Fork 0

avahi: Remove poll timeout when possible.

Fixes <https://issues.guix.gnu.org/45314>.

* guix/avahi.scm (avahi-browse-service-thread): Change timeout default value
to false when no "stop-loop?" procedure is passed. Adapt "iterate-simple-poll"
call accordingly.

Signed-off-by: Mathieu Othacehe <othacehe@gnu.org>
master
Ludovic Courtès 2020-12-18 18:10:04 +01:00 committed by Mathieu Othacehe
parent e03552d5d4
commit f9978346e7
No known key found for this signature in database
GPG Key ID: 8354763531769CA6
1 changed files with 11 additions and 3 deletions

View File

@ -89,13 +89,19 @@ when STOP-LOOP? procedure returns true."
(close-port socket)
ip))
(define never
;; Never true.
(const #f))
(define* (avahi-browse-service-thread proc
#:key
types
(ignore-local? #t)
(family AF_INET)
(stop-loop? (const #f))
(timeout 100))
(stop-loop? never)
(timeout (if (eq? stop-loop? never)
#f
100)))
"Browse services which type is part of the TYPES list, using Avahi. The
search is restricted to services with the given FAMILY. Each time a service
is found or removed, PROC is called and passed as argument the corresponding
@ -167,4 +173,6 @@ when STOP-LOOP? procedure returns true."
client-callback)))
(and (client? client)
(while (not (stop-loop?))
(iterate-simple-poll poll timeout)))))
(if timeout
(iterate-simple-poll poll timeout)
(iterate-simple-poll poll))))))