summaryrefslogtreecommitdiff
path: root/src/login
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2018-11-10 22:50:11 +0900
committerYu Watanabe <watanabe.yu+github@gmail.com>2018-11-10 22:53:00 +0900
commitdeb2b7348e746df9a471b61d71b41b0e871cacde (patch)
tree815fecf2b58edae1cc1394911fa10981d34a25f9 /src/login
parentbf7712b63e70143e2b59e7f0d264293e6ca61d4d (diff)
downloadsystemd-deb2b7348e746df9a471b61d71b41b0e871cacde.tar.gz
systemd-deb2b7348e746df9a471b61d71b41b0e871cacde.tar.bz2
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.c24
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;