diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2015-04-11 11:38:34 -0400 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2015-04-12 10:20:36 -0400 |
commit | c89280f811a0dc0a2cb071cb83072375345f4bd2 (patch) | |
tree | de55777192f30b423c7593223d345be45b2c6552 /src/udev/udev-builtin-keyboard.c | |
parent | c7e3c3ecac63e772dab4f767b18b7574c496e56c (diff) |
udev-builtin-keyboard: make error messages more standard
- No need to add "Error, " prefix, we already have that as metadata.
- Also use double quotes for path names, as in most other places.
- Remove stray newline at end of message.
- Downgrade error messages after which we continue to warnings.
Diffstat (limited to 'src/udev/udev-builtin-keyboard.c')
-rw-r--r-- | src/udev/udev-builtin-keyboard.c | 28 |
1 files changed, 13 insertions, 15 deletions
diff --git a/src/udev/udev-builtin-keyboard.c b/src/udev/udev-builtin-keyboard.c index 2a71ea56a5..c7f7f84afd 100644 --- a/src/udev/udev-builtin-keyboard.c +++ b/src/udev/udev-builtin-keyboard.c @@ -80,7 +80,7 @@ static void map_keycode(int fd, const char *devnode, int scancode, const char *k /* check if it's a numeric code already */ keycode_num = strtoul(keycode, &endptr, 0); if (endptr[0] !='\0') { - log_error("Error, unknown key identifier '%s'", keycode); + log_error("Unknown key identifier '%s'", keycode); return; } } @@ -123,8 +123,7 @@ static void override_abs(int fd, const char *devnode, rc = ioctl(fd, EVIOCGABS(evcode), &absinfo); if (rc < 0) { - log_error_errno(errno, "Error, unable to EVIOCGABS device '%s'", - devnode); + log_error_errno(errno, "Unable to EVIOCGABS device \"%s\"", devnode); return; } @@ -134,18 +133,17 @@ static void override_abs(int fd, const char *devnode, next = parse_token(next, &absinfo.fuzz); next = parse_token(next, &absinfo.flat); if (!next) { - log_error("Error, unable to parse EV_ABS override '%s' for '%s'\n", - value, devnode); + log_error("Unable to parse EV_ABS override '%s' for '%s'", value, devnode); return; } - log_debug("keyboard: override %x with %d/%d/%d/%d/%d", evcode, - absinfo.minimum, absinfo.maximum, absinfo.resolution, - absinfo.fuzz, absinfo.flat); + log_debug("keyboard: %x overriden with %"PRIi32"/%"PRIi32"/%"PRIi32"/%"PRIi32"/%"PRIi32" for \"%s\"", + evcode, + absinfo.minimum, absinfo.maximum, absinfo.resolution, absinfo.fuzz, absinfo.flat, + devnode); rc = ioctl(fd, EVIOCSABS(evcode), &absinfo); if (rc < 0) - log_error_errno(errno, "Error, unable to update device '%s'", - devnode); + log_error_errno(errno, "Unable to EVIOCSABS device \"%s\"", devnode); } static int open_device(const char *devnode) { @@ -153,9 +151,9 @@ static int open_device(const char *devnode) { fd = open(devnode, O_RDWR|O_CLOEXEC|O_NONBLOCK|O_NOCTTY); if (fd < 0) - log_error_errno(errno, "Error, opening device '%s': %m", devnode); + return log_error_errno(errno, "Error opening device \"%s\": %m", devnode); - return fd < 0 ? -errno : fd; + return fd; } static int builtin_keyboard(struct udev_device *dev, int argc, char *argv[], bool test) { @@ -167,7 +165,7 @@ static int builtin_keyboard(struct udev_device *dev, int argc, char *argv[], boo node = udev_device_get_devnode(dev); if (!node) { - log_error("Error, no device node for '%s'", udev_device_get_syspath(dev)); + log_error("No device node for \"%s\"", udev_device_get_syspath(dev)); return EXIT_FAILURE; } @@ -183,7 +181,7 @@ static int builtin_keyboard(struct udev_device *dev, int argc, char *argv[], boo /* 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); + log_warning("Unable to parse scan code from \"%s\"", key); continue; } @@ -214,7 +212,7 @@ static int builtin_keyboard(struct udev_device *dev, int argc, char *argv[], boo /* EVDEV_ABS_<EV_ABS code>=<min>:<max>:<res>:<fuzz>:<flat> */ evcode = strtoul(key + 10, &endptr, 16); if (endptr[0] != '\0') { - log_error("Error, unable to parse EV_ABS code from '%s'", key); + log_warning("Unable to parse EV_ABS code from \"%s\"", key); continue; } |