dcavalca / rpms / systemd

Forked from rpms/systemd 3 months ago
Clone
aed857
From fa22d8e9697a0a896007998fdf2cabe7baf98bec Mon Sep 17 00:00:00 2001
aed857
From: Peter Hutterer <peter.hutterer@who-t.net>
aed857
Date: Tue, 10 Jan 2017 17:36:46 +1000
aed857
Subject: [PATCH] udev: add ID_INPUT_SWITCH for devices with switch capability
aed857
 (#5057)
aed857
aed857
(cherry picked from commit 64083a6078630372623bb1013a45d3bf31d8a836)
aed857
aed857
Resolves: #1597240
aed857
---
aed857
 src/udev/udev-builtin-input_id.c | 3 +++
aed857
 1 file changed, 3 insertions(+)
aed857
aed857
diff --git a/src/udev/udev-builtin-input_id.c b/src/udev/udev-builtin-input_id.c
aed857
index 46f1c539d..d6ae07304 100644
aed857
--- a/src/udev/udev-builtin-input_id.c
aed857
+++ b/src/udev/udev-builtin-input_id.c
aed857
@@ -250,6 +250,9 @@ static int builtin_input_id(struct udev_device *dev, int argc, char *argv[], boo
aed857
                 get_cap_mask(dev, pdev, "capabilities/key", bitmask_key, sizeof(bitmask_key), test);
aed857
                 test_pointers(dev, bitmask_ev, bitmask_abs, bitmask_key, bitmask_rel, test);
aed857
                 test_key(dev, bitmask_ev, bitmask_key, test);
aed857
+
aed857
+                if (test_bit(EV_SW, bitmask_ev))
aed857
+                        udev_builtin_add_property(dev, test, "ID_INPUT_SWITCH", "1");
aed857
         }
aed857
 
aed857
         devnode = udev_device_get_devnode(dev);