diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2018-10-29 08:50:39 +0100 |
---|---|---|
committer | Yu Watanabe <watanabe.yu+github@gmail.com> | 2018-11-12 15:25:40 +0100 |
commit | 46f0fbd8fd8ed1428b6f038b88375935e722eeaa (patch) | |
tree | 0c034f3c25b5feb0a15aa5bd985379fd2fa4d3f6 /src/udev/udevadm-control.c | |
parent | udev: use parse_sec() to parse --event-timeout option (diff) | |
download | systemd-46f0fbd8fd8ed1428b6f038b88375935e722eeaa.tar.xz systemd-46f0fbd8fd8ed1428b6f038b88375935e722eeaa.zip |
udev: drop util_log_priority() and use log_level_from_string()
The function util_log_priority() is almost same as
log_level_from_string(). The difference between them is only that
util_log_priority() accepts such that '3 hogehoge'.
Diffstat (limited to 'src/udev/udevadm-control.c')
-rw-r--r-- | src/udev/udevadm-control.c | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/src/udev/udevadm-control.c b/src/udev/udevadm-control.c index 22ac4962ed..d9320418cf 100644 --- a/src/udev/udevadm-control.c +++ b/src/udev/udevadm-control.c @@ -19,9 +19,9 @@ #include <string.h> #include <unistd.h> -#include "libudev-private.h" #include "parse-util.h" #include "process-util.h" +#include "syslog-util.h" #include "time-util.h" #include "udevadm.h" #include "udev-ctrl.h" @@ -84,18 +84,15 @@ int control_main(int argc, char *argv[], void *userdata) { if (r < 0) return r; break; - case 'l': { - int i; - - i = util_log_priority(optarg); - if (i < 0) - return log_error_errno(i, "invalid number '%s'", optarg); + case 'l': + r = log_level_from_string(optarg); + if (r < 0) + return log_error_errno(r, "Failed to parse log priority '%s': %m", optarg); - r = udev_ctrl_send_set_log_level(uctrl, i, timeout); + r = udev_ctrl_send_set_log_level(uctrl, r, timeout); if (r < 0) return r; break; - } case 's': r = udev_ctrl_send_stop_exec_queue(uctrl, timeout); if (r < 0) |