Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Monitor timeout bugfix v2 #10

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions modules/udev/monitor.scm
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
;;; Code:

(define-module (udev monitor)
#:use-module (srfi srfi-1)
#:export (udev-monitor
udev-monitor?
%make-udev-monitor
Expand Down Expand Up @@ -64,9 +63,11 @@ 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)))
(apply udev-monitor-set-timeout!
(cons monitor
(filter-map identity (list timeout-sec timeout-usec))))
;; Guile's select accepts #f for its optional 'secs' argument,
;; but not for usecs'.
(if timeout-usec
(udev-monitor-set-timeout! monitor timeout-sec timeout-usec)
(udev-monitor-set-timeout! monitor timeout-sec))
(udev-monitor-set-callback! monitor callback)
(udev-monitor-set-error-callback! monitor error-callback)
(when filter
Expand Down
Loading