diff options
author | David Herrmann <dh.herrmann@gmail.com> | 2013-10-22 00:28:08 +0200 |
---|---|---|
committer | Jonas Ã…dahl <jadahl@gmail.com> | 2013-11-16 21:54:07 +0100 |
commit | facf1dd2645147630b29e20262534f06f5d04343 (patch) | |
tree | 3f7b7d2cee44b1d1b002865c73c1834ea751a0e1 /src/udev-seat.c | |
parent | d26428475a58e69a938aac9393b7cdaa433e8b26 (diff) |
launcher: add weston_launcher_close() dummy
If you request a device via weston_launcher_open(), you should now release
it via weston_launcher_close() instead of close(). This is currently not
needed but will be required for logind devices.
Diffstat (limited to 'src/udev-seat.c')
-rw-r--r-- | src/udev-seat.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/src/udev-seat.c b/src/udev-seat.c index ffaf08a..deceb50 100644 --- a/src/udev-seat.c +++ b/src/udev-seat.c @@ -83,11 +83,11 @@ device_added(struct udev_device *udev_device, struct udev_input *input) device = evdev_device_create(&seat->base, devnode, fd); if (device == EVDEV_UNHANDLED_DEVICE) { - close(fd); + weston_launcher_close(c->launcher, fd); weston_log("not using input device '%s'.\n", devnode); return 0; } else if (device == NULL) { - close(fd); + weston_launcher_close(c->launcher, fd); weston_log("failed to create input device '%s'.\n", devnode); return 0; } @@ -219,9 +219,11 @@ evdev_udev_handler(int fd, uint32_t mask, void *data) if (!strcmp(device->devnode, devnode)) { weston_log("input device %s, %s removed\n", device->devname, device->devnode); + weston_launcher_close(input->compositor->launcher, + device->fd); evdev_device_destroy(device); - break; - } + break; + } } } @@ -278,8 +280,11 @@ udev_input_remove_devices(struct udev_input *input) struct udev_seat *seat; wl_list_for_each(seat, &input->compositor->seat_list, base.link) { - wl_list_for_each_safe(device, next, &seat->devices_list, link) + wl_list_for_each_safe(device, next, &seat->devices_list, link) { + weston_launcher_close(input->compositor->launcher, + device->fd); evdev_device_destroy(device); + } if (seat->base.keyboard) notify_keyboard_focus_out(&seat->base); |