#define KDSKBMUTE 0x4B51
#endif
+#ifndef EVIOCREVOKE
+#define EVIOCREVOKE _IOW('E', 0x91, int)
+#endif
+
#define MAX_ARGV_SIZE 256
struct weston_launch {
int ttynr;
int sock[2];
int drm_fd;
+ int last_input_fd;
int kb_mode;
struct passwd *pw;
if (fd != -1 && major(s.st_rdev) == DRM_MAJOR)
wl->drm_fd = fd;
+ if (fd != -1 && major(s.st_rdev) == INPUT_MAJOR &&
+ wl->last_input_fd < fd)
+ wl->last_input_fd = fd;
return 0;
}
exit(status);
}
+static void
+close_input_fds(struct weston_launch *wl)
+{
+ struct stat s;
+ int fd;
+
+ for (fd = 3; fd <= wl->last_input_fd; fd++) {
+ if (fstat(fd, &s) == 0 && major(s.st_rdev) == INPUT_MAJOR) {
+ /* EVIOCREVOKE may fail if the kernel doesn't
+ * support it, but all we can do is ignore it. */
+ ioctl(fd, EVIOCREVOKE, 0);
+ close(fd);
+ }
+ }
+}
+
static int
handle_signal(struct weston_launch *wl)
{
break;
case SIGUSR1:
send_reply(wl, WESTON_LAUNCHER_DEACTIVATE);
+ close_input_fds(wl);
drmDropMaster(wl->drm_fd);
ioctl(wl->tty, VT_RELDISP, 1);
break;