From f9d363fece0046cabfa00ad6b72b50f45b70db60 Mon Sep 17 00:00:00 2001 From: Scott Anderson Date: Sun, 14 May 2017 13:07:34 +1200 Subject: Added device matching --- session/logind.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'session') diff --git a/session/logind.c b/session/logind.c index b6763bf9..6f0327e6 100644 --- a/session/logind.c +++ b/session/logind.c @@ -198,8 +198,12 @@ static int pause_device(sd_bus_message *msg, void *userdata, sd_bus_error *ret_e goto error; } - dev_t dev = makedev(major, minor); - wl_signal_emit(&session->base.device_paused, &dev); + struct device_arg arg = { + .dev = makedev(major, minor), + .fd = -1, + }; + + wl_signal_emit(&session->base.device_paused, &arg); ret = sd_bus_call_method(session->bus, "org.freedesktop.login1", session->path, "org.freedesktop.login1.Session", "PauseDeviceComplete", @@ -226,9 +230,12 @@ static int resume_device(sd_bus_message *msg, void *userdata, sd_bus_error *ret_ goto error; } - // TODO: Use major/minor to make sure the right devices are getting signals + struct device_arg arg = { + .dev = makedev(major, minor), + .fd = fd, + }; - wl_signal_emit(&session->base.device_resumed, &fd); + wl_signal_emit(&session->base.device_resumed, &arg); error: return 0; -- cgit v1.2.3