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

Udev monitor improvements #8

Merged

Commits on Dec 23, 2023

  1. monitor: Fix bug using callback procedure in place of error callback.

    * modules/udev/monitor.scm (make-udev-monitor): Apply
    udev-monitor-set-error-callback! to the error-callback default procedure, no
    the callback one.
    Apteryks committed Dec 23, 2023
    Configuration menu
    Copy the full SHA
    e8e87ec View commit details
    Browse the repository at this point in the history
  2. Fix typo in error message of the monitor scanner.

    * libguile-udev/udev-monitor-func.c (udev_monitor_scanner): Fix typo.
    Apteryks committed Dec 23, 2023
    Configuration menu
    Copy the full SHA
    3187ba7 View commit details
    Browse the repository at this point in the history
  3. Do not poll when omitting timeout values for the monitor scanner.

    Previously, it would default to use a 0 s timeout, which for select means that
    it doesn't block (it would poll continuously and waste CPU).  This change
    unifies the make-udev-monitor/udev-monitor-set-timeout! interface with that of
    Guile's select procedure.
    
    * NEWS: Update news.
    * doc/guile-udev.texi (API Reference): Update doc.
    * examples/device-listener.scm (main)
    <make-udev-monitor>: Remove timeout arguments.
    * libguile-udev/udev-monitor-func.c
    (udev-monitor-set-timeout!): Make timeout arguments optional.  Update doc.
    Streamline definition, removing all arguments validation, which is now handled
    by scm_select.
    * libguile-udev/udev-monitor-func.c (select_args_data): New struct.
    (call_select, false_on_exception): New procedures.
    (udev_monitor_scanner): Replace C select call with scm_select call, adjusting
    the rest accordingly.
    * libguile-udev/udev-monitor-type.h: Replace timeout member with new 'secs'
    and 'usecs' ones.
    * libguile-udev/udev-monitor-type.c (gudev_monitor_to_scm): Set default values
    of secs and usecs to SCM_BOOL_F.
    * modules/udev/monitor.scm (make-udev-monitor): Do not specify default values
    for filter, timeout-sec and timeout-usec keyword arguments.  Update doc.
    
    Fixes: artyom-poptsov#5
    Apteryks committed Dec 23, 2023
    Configuration menu
    Copy the full SHA
    980fe40 View commit details
    Browse the repository at this point in the history