diff --git a/hw/xfree86/os-support/linux/systemd-logind.c b/hw/xfree86/os-support/linux/systemd-logind.c index c6a24fc7b..3254b2ce3 100644 --- a/hw/xfree86/os-support/linux/systemd-logind.c +++ b/hw/xfree86/os-support/linux/systemd-logind.c @@ -397,6 +397,11 @@ message_filter(DBusConnection * connection, DBusMessage * message, void *data) dbus_error_free(&error); return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; } + + /* + * fd will be received via DBus if and only if pause == 0, so it + * only needs to be closed in that code path + */ } else return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; @@ -431,6 +436,7 @@ message_filter(DBusConnection * connection, DBusMessage * message, void *data) info->active = TRUE; if (pdev) { + close(fd); pdev->flags &= ~XF86_PDEV_PAUSED; } else systemd_logind_set_input_fd_for_all_devs(major, minor, fd,