diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2015-03-20 14:00:31 +1000 |
---|---|---|
committer | Anthony G. Basile <blueness@gentoo.org> | 2015-04-12 12:27:47 -0400 |
commit | e2e87476528958e9b377bb4dd9073a8261387075 (patch) | |
tree | 54a43157c3a72b5a46d717903d7247c954f205bc /src/udev/udev-builtin-keyboard.c | |
parent | ca9aee0fac701be837d50a56d575cc10a39c5bc9 (diff) |
udev: builtin-keyboard: invert a condition
No functional changes, just to make the next patch easier to review
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
Diffstat (limited to 'src/udev/udev-builtin-keyboard.c')
-rw-r--r-- | src/udev/udev-builtin-keyboard.c | 56 |
1 files changed, 28 insertions, 28 deletions
diff --git a/src/udev/udev-builtin-keyboard.c b/src/udev/udev-builtin-keyboard.c index f33401790c..86f4018ef5 100644 --- a/src/udev/udev-builtin-keyboard.c +++ b/src/udev/udev-builtin-keyboard.c @@ -115,43 +115,43 @@ static int builtin_keyboard(struct udev_device *dev, int argc, char *argv[], boo udev_list_entry_foreach(entry, udev_device_get_properties_list_entry(dev)) { const char *key; char *endptr; - unsigned scancode; - const char *keycode; key = udev_list_entry_get_name(entry); - if (!startswith(key, "KEYBOARD_KEY_")) - continue; - - /* KEYBOARD_KEY_<hex scan code>=<key identifier string> */ - scancode = strtoul(key + 13, &endptr, 16); - if (endptr[0] != '\0') { - log_error("Error, unable to parse scan code from '%s'", key); - continue; - } + if (startswith(key, "KEYBOARD_KEY_")) { + const char *keycode; + unsigned scancode; + + /* KEYBOARD_KEY_<hex scan code>=<key identifier string> */ + scancode = strtoul(key + 13, &endptr, 16); + if (endptr[0] != '\0') { + log_error("Error, unable to parse scan code from '%s'", key); + continue; + } - keycode = udev_list_entry_get_value(entry); + keycode = udev_list_entry_get_value(entry); - /* a leading '!' needs a force-release entry */ - if (keycode[0] == '!') { - keycode++; + /* a leading '!' needs a force-release entry */ + if (keycode[0] == '!') { + keycode++; - release[release_count] = scancode; - if (release_count < ELEMENTSOF(release)-1) - release_count++; + release[release_count] = scancode; + if (release_count < ELEMENTSOF(release)-1) + release_count++; - if (keycode[0] == '\0') - continue; - } + if (keycode[0] == '\0') + continue; + } - if (fd == -1) { - fd = open(node, O_RDWR|O_CLOEXEC|O_NONBLOCK|O_NOCTTY); - if (fd < 0) { - log_error_errno(errno, "Error, opening device '%s': %m", node); - return EXIT_FAILURE; + if (fd == -1) { + fd = open(node, O_RDWR|O_CLOEXEC|O_NONBLOCK|O_NOCTTY); + if (fd < 0) { + log_error_errno(errno, "Error, opening device '%s': %m", node); + return EXIT_FAILURE; + } } - } - map_keycode(fd, node, scancode, keycode); + map_keycode(fd, node, scancode, keycode); + } } /* install list of force-release codes */ |