emacs-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#45314: closed (‘guix discover’ polls)


From: GNU bug Tracking System
Subject: bug#45314: closed (‘guix discover’ polls)
Date: Sun, 20 Dec 2020 09:44:01 +0000

Your message dated Sun, 20 Dec 2020 10:43:00 +0100
with message-id <87czz4g6e3.fsf@gnu.org>
and subject line Re: bug#45314: ‘guix discover’ polls
has caused the debbugs.gnu.org bug report #45314,
regarding ‘guix discover’ polls
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs@gnu.org.)


-- 
45314: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=45314
GNU Bug Tracking System
Contact help-debbugs@gnu.org with problems
--- Begin Message --- Subject: ‘guix discover’ polls Date: Fri, 18 Dec 2020 18:10:04 +0100 User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)
Hi!

‘guix discover’ polls with 100ms intervals:

--8<---------------cut here---------------start------------->8---
18:00:57 poll([{fd=14, events=POLLIN}, {fd=16, events=POLLIN}], 2, 100) = 0 
(Timeout)
18:00:57 rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0
18:00:57 poll([{fd=14, events=POLLIN}, {fd=16, events=POLLIN}], 2, 100) = 0 
(Timeout)
18:00:57 rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0
18:00:57 poll([{fd=14, events=POLLIN}, {fd=16, events=POLLIN}], 2, 100) = 0 
(Timeout)
18:00:57 rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0
18:00:57 poll([{fd=14, events=POLLIN}, {fd=16, events=POLLIN}], 2, 100) = 0 
(Timeout)
18:00:57 rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0
18:00:57 poll([{fd=14, events=POLLIN}, {fd=16, events=POLLIN}], 2, 100) = 0 
(Timeout)
18:00:57 rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0
18:00:57 poll([{fd=14, events=POLLIN}, {fd=16, events=POLLIN}], 2, 100) = 0 
(Timeout)
18:00:57 rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0
18:00:57 poll([{fd=14, events=POLLIN}, {fd=16, events=POLLIN}], 2, 100) = 0 
(Timeout)
18:00:58 rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0
18:00:58 poll([{fd=14, events=POLLIN}, {fd=16, events=POLLIN}], 2, 100) = 0 
(Timeout)
--8<---------------cut here---------------end--------------->8---

This comes from ‘avahi-browse-service-thread’ in (guix avahi) and its
100ms #:timeout.

How about the change below?

Thanks,
Ludo’.

diff --git a/guix/avahi.scm b/guix/avahi.scm
index aa90a5cdd4..132e42f268 100644
--- a/guix/avahi.scm
+++ b/guix/avahi.scm
@@ -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))))))

--- End Message ---
--- Begin Message --- Subject: Re: bug#45314: ‘guix discover’ polls Date: Sun, 20 Dec 2020 10:43:00 +0100 User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)
Hey Ludo,

> How about the change below?

I think it looks nice! I pushed it as
f9978346e73359ac1d8b88c9ed874edc7225582b.

Thanks,

Mathieu


--- End Message ---

reply via email to

[Prev in Thread] Current Thread [Next in Thread]