Skip to content

Commit

Permalink
Do not apply udev-monitor-set-timeout! to #f values.
Browse files Browse the repository at this point in the history
This is a follow-up to commit 980fe40, which changed the default timeout-sec
and timeout-usec values to #f, with the behavior of waiting indefinitely for
an event.

* modules/udev/monitor.scm (make-udev-monitor): Filter out arguments whose
values are #f.
  • Loading branch information
Apteryks committed Dec 28, 2023
1 parent 82e7e51 commit 2014b87
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion modules/udev/monitor.scm
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
;;; Code:

(define-module (udev monitor)
#:use-module (srfi srfi-1)
#:export (udev-monitor
udev-monitor?
%make-udev-monitor
Expand Down Expand Up @@ -63,7 +64,9 @@ seconds and microseconds, respectively. If TIMEOUT-USEC, is used, TIMEOUT-SEC
must also have a value, else it is ignored, as for the 'secs' and 'usecs'
argument of Guile's 'select' procedure."
(let ((monitor (%make-udev-monitor udev)))
(udev-monitor-set-timeout! monitor timeout-sec timeout-usec)
(apply udev-monitor-set-timeout!
(cons monitor
(filter-map identity (list timeout-sec timeout-usec))))
(udev-monitor-set-callback! monitor callback)
(udev-monitor-set-error-callback! monitor error-callback)
(when filter
Expand Down

0 comments on commit 2014b87

Please sign in to comment.