chiark / gitweb /
logind: fix sd_eviocrevoke ioctl call
authorPeter Hutterer <peter.hutterer@who-t.net>
Thu, 22 Jan 2015 01:36:02 +0000 (11:36 +1000)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 22 Jan 2015 15:53:29 +0000 (10:53 -0500)
If the third argument is non-null, the kernel will always error out with
EINVAL and devices won't get revoked.

Reported-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
src/login/logind-session-device.c

index 932abb8..c2de862 100644 (file)
@@ -107,7 +107,7 @@ static int sd_eviocrevoke(int fd) {
 
         assert(fd >= 0);
 
-        r = ioctl(fd, EVIOCREVOKE, 1);
+        r = ioctl(fd, EVIOCREVOKE, NULL);
         if (r < 0) {
                 r = -errno;
                 if (r == -EINVAL && !warned) {