From deb2b7348e746df9a471b61d71b41b0e871cacde Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Sat, 10 Nov 2018 22:50:11 +0900 Subject: sd-device: drop priority and description from sd_device_monitor_attach_event() and sd_device_monitor_start() Now we have sd_device_monitor_get_event_soruce(). So, it is not necessary to include these parameters in the functions for sd_device_monitor. --- src/udev/udevadm-monitor.c | 7 +++++-- src/udev/udevadm-trigger.c | 4 ++-- 2 files changed, 7 insertions(+), 4 deletions(-) (limited to 'src/udev') diff --git a/src/udev/udevadm-monitor.c b/src/udev/udevadm-monitor.c index ae8e06111e..f7737d0790 100644 --- a/src/udev/udevadm-monitor.c +++ b/src/udev/udevadm-monitor.c @@ -67,7 +67,7 @@ static int setup_monitor(MonitorNetlinkGroup sender, sd_event *event, sd_device_ (void) sd_device_monitor_set_receive_buffer_size(monitor, 128*1024*1024); - r = sd_device_monitor_attach_event(monitor, event, 0); + r = sd_device_monitor_attach_event(monitor, event); if (r < 0) return log_error_errno(r, "Failed to attach event: %m"); @@ -84,10 +84,13 @@ static int setup_monitor(MonitorNetlinkGroup sender, sd_event *event, sd_device_ return log_error_errno(r, "Failed to apply tag filter '%s': %m", tag); } - r = sd_device_monitor_start(monitor, device_monitor_handler, INT_TO_PTR(sender), sender == MONITOR_GROUP_UDEV ? "device-monitor-udev" : "device-monitor-kernel"); + r = sd_device_monitor_start(monitor, device_monitor_handler, INT_TO_PTR(sender)); if (r < 0) return log_error_errno(r, "Failed to start device monitor: %m"); + (void) sd_event_source_set_description(sd_device_monitor_get_event_source(monitor), + sender == MONITOR_GROUP_UDEV ? "device-monitor-udev" : "device-monitor-kernel"); + *ret = TAKE_PTR(monitor); return 0; } diff --git a/src/udev/udevadm-trigger.c b/src/udev/udevadm-trigger.c index 185fe29be0..38035b5c92 100644 --- a/src/udev/udevadm-trigger.c +++ b/src/udev/udevadm-trigger.c @@ -305,11 +305,11 @@ int trigger_main(int argc, char *argv[], void *userdata) { if (r < 0) return log_error_errno(r, "Failed to create device monitor object: %m"); - r = sd_device_monitor_attach_event(m, event, 0); + r = sd_device_monitor_attach_event(m, event); if (r < 0) return log_error_errno(r, "Failed to attach event to device monitor: %m"); - r = sd_device_monitor_start(m, device_monitor_handler, settle_set, "udevadm-trigger-device-monitor"); + r = sd_device_monitor_start(m, device_monitor_handler, settle_set); if (r < 0) return log_error_errno(r, "Failed to start device monitor: %m"); } -- cgit v1.2.3