diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2018-11-10 14:50:11 +0100 |
---|---|---|
committer | Yu Watanabe <watanabe.yu+github@gmail.com> | 2018-11-10 14:53:00 +0100 |
commit | deb2b7348e746df9a471b61d71b41b0e871cacde (patch) | |
tree | 815fecf2b58edae1cc1394911fa10981d34a25f9 /src/login | |
parent | sd-device: add sd_device_monitor_get_event_source() (diff) | |
download | systemd-deb2b7348e746df9a471b61d71b41b0e871cacde.tar.xz systemd-deb2b7348e746df9a471b61d71b41b0e871cacde.zip |
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.
Diffstat (limited to 'src/login')
-rw-r--r-- | src/login/logind.c | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/src/login/logind.c b/src/login/logind.c index e7de3c12e4..a1ab9626b5 100644 --- a/src/login/logind.c +++ b/src/login/logind.c @@ -832,14 +832,16 @@ static int manager_connect_udev(Manager *m) { if (r < 0) return r; - r = sd_device_monitor_attach_event(m->device_seat_monitor, m->event, 0); + r = sd_device_monitor_attach_event(m->device_seat_monitor, m->event); if (r < 0) return r; - r = sd_device_monitor_start(m->device_seat_monitor, manager_dispatch_seat_udev, m, "logind-seat-monitor"); + r = sd_device_monitor_start(m->device_seat_monitor, manager_dispatch_seat_udev, m); if (r < 0) return r; + (void) sd_event_source_set_description(sd_device_monitor_get_event_source(m->device_seat_monitor), "logind-seat-monitor"); + r = sd_device_monitor_new(&m->device_monitor); if (r < 0) return r; @@ -856,14 +858,16 @@ static int manager_connect_udev(Manager *m) { if (r < 0) return r; - r = sd_device_monitor_attach_event(m->device_monitor, m->event, 0); + r = sd_device_monitor_attach_event(m->device_monitor, m->event); if (r < 0) return r; - r = sd_device_monitor_start(m->device_monitor, manager_dispatch_device_udev, m, "logind-device-monitor"); + r = sd_device_monitor_start(m->device_monitor, manager_dispatch_device_udev, m); if (r < 0) return r; + (void) sd_event_source_set_description(sd_device_monitor_get_event_source(m->device_monitor), "logind-device-monitor"); + /* Don't watch keys if nobody cares */ if (!manager_all_buttons_ignored(m)) { r = sd_device_monitor_new(&m->device_button_monitor); @@ -878,13 +882,15 @@ static int manager_connect_udev(Manager *m) { if (r < 0) return r; - r = sd_device_monitor_attach_event(m->device_button_monitor, m->event, 0); + r = sd_device_monitor_attach_event(m->device_button_monitor, m->event); if (r < 0) return r; - r = sd_device_monitor_start(m->device_button_monitor, manager_dispatch_button_udev, m, "logind-button-monitor"); + r = sd_device_monitor_start(m->device_button_monitor, manager_dispatch_button_udev, m); if (r < 0) return r; + + (void) sd_event_source_set_description(sd_device_monitor_get_event_source(m->device_button_monitor), "logind-button-monitor"); } /* Don't bother watching VCSA devices, if nobody cares */ @@ -898,13 +904,15 @@ static int manager_connect_udev(Manager *m) { if (r < 0) return r; - r = sd_device_monitor_attach_event(m->device_vcsa_monitor, m->event, 0); + r = sd_device_monitor_attach_event(m->device_vcsa_monitor, m->event); if (r < 0) return r; - r = sd_device_monitor_start(m->device_vcsa_monitor, manager_dispatch_vcsa_udev, m, "logind-vcsa-monitor"); + r = sd_device_monitor_start(m->device_vcsa_monitor, manager_dispatch_vcsa_udev, m); if (r < 0) return r; + + (void) sd_event_source_set_description(sd_device_monitor_get_event_source(m->device_vcsa_monitor), "logind-vcsa-monitor"); } return 0; |